mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-21 18:32:13 +03:00
Don't use sizeof() on a VARIABLE_ARRAY
In the alloca() case, this fails to be the right size.
This commit is contained in:
parent
1d01206bbc
commit
c584fc75bb
1 changed files with 2 additions and 2 deletions
|
|
@ -494,7 +494,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque,
|
|||
size_t isz;
|
||||
unsigned i, ninitialized;
|
||||
|
||||
isz = sizeof(initialized);
|
||||
isz = sizeof(bool) * narenas;
|
||||
xmallctl("arenas.initialized", initialized,
|
||||
&isz, NULL, 0);
|
||||
for (i = ninitialized = 0; i < narenas; i++) {
|
||||
|
|
@ -523,7 +523,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque,
|
|||
size_t isz;
|
||||
unsigned i;
|
||||
|
||||
isz = sizeof(initialized);
|
||||
isz = sizeof(bool) * narenas;
|
||||
xmallctl("arenas.initialized", initialized,
|
||||
&isz, NULL, 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue