diff --git a/ChangeLog.md b/ChangeLog.md index 626c0a505c82b..e1f7ba8b982d9 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -64,6 +64,8 @@ See docs/process.md for more on how version tagging works. - JavaScript libraries can now be specified via `-lfoo.js`. This works like the existing `--js-library` flag but will search the library path (all paths specified with `-L`) for `libfoo.js`. (#23338) +- The `mallinfo` struct members are now defined as `size_t` which makes them + compatible with larger memories is also how linux defines them. (#23368) 3.1.74 - 12/14/24 ----------------- diff --git a/system/include/compat/malloc.h b/system/include/compat/malloc.h index 279bec3f1d2dc..80563d0debc1e 100644 --- a/system/include/compat/malloc.h +++ b/system/include/compat/malloc.h @@ -11,16 +11,16 @@ extern "C" { system/lib/dlmalloc.c. */ struct mallinfo { - int arena; /* total space allocated from system */ - int ordblks; /* number of non-inuse chunks */ - int smblks; /* unused -- always zero */ - int hblks; /* number of mmapped regions */ - int hblkhd; /* total space in mmapped regions */ - int usmblks; /* unused -- always zero */ - int fsmblks; /* unused -- always zero */ - int uordblks; /* total allocated space */ - int fordblks; /* total non-inuse space */ - int keepcost; /* top-most, releasable (via malloc_trim) space */ + size_t arena; /* total space allocated from system */ + size_t ordblks; /* number of non-inuse chunks */ + size_t smblks; /* unused -- always zero */ + size_t hblks; /* number of mmapped regions */ + size_t hblkhd; /* total space in mmapped regions */ + size_t usmblks; /* unused -- always zero */ + size_t fsmblks; /* unused -- always zero */ + size_t uordblks; /* total allocated space */ + size_t fordblks; /* total non-inuse space */ + size_t keepcost; /* top-most, releasable (via malloc_trim) space */ }; /* The routines. */ diff --git a/system/lib/dlmalloc.c b/system/lib/dlmalloc.c index 5c4de3fe03c89..7dc91503f1bec 100644 --- a/system/lib/dlmalloc.c +++ b/system/lib/dlmalloc.c @@ -16,7 +16,6 @@ #define ABORT __builtin_unreachable() /* allow malloc stats only in debug builds, which brings in stdio code. */ #define NO_MALLOC_STATS 1 -#define MALLINFO_FIELD_TYPE int #endif /* XXX Emscripten Tracing API. This defines away the code if tracing is disabled. */ #include