]> git.kaiwu.me - quickjs.git/commitdiff
Remove unnecessary ssize_t posix-ism
authorBen Noordhuis <info@bnoordhuis.nl>
Fri, 16 Feb 2024 09:25:29 +0000 (10:25 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 16 Feb 2024 09:25:29 +0000 (10:25 +0100)
ssize_t is not always available and the cast it was used in wasn't
necessary in the first place, the value already has the right type.

Note that the field malloc_limit is an int64_t in JSMemoryUsage whereas it
is a size_t in JSMallocState.

quickjs.c

index fccf340613353cc54e1bd99d4da2478ae30f99bc..c3db0385d1c65918764d32a8c8ddac3fb2768fbd 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -6242,7 +6242,7 @@ void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt)
             "BigNum "
 #endif
             CONFIG_VERSION " version, %d-bit, malloc limit: %"PRId64"\n\n",
-            (int)sizeof(void *) * 8, (int64_t)(ssize_t)s->malloc_limit);
+            (int)sizeof(void *) * 8, s->malloc_limit);
 #if 1
     if (rt) {
         static const struct {