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
@ -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…
Reference in New Issue
Block a user