mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-22 04:03:11 +00:00
arena_s: Replace bin_t all_bins[0] by [] for C99 or newer
Zero-sized arrays are not allowed by ISO C. C99 introduced a way to express this. Type-checking fails, because all_bins is asigned malloced storage of length > 0. Found by GCC and Clang (-Wpedantic).
This commit is contained in:
committed by
Slobodan Predolac
parent
295e48944b
commit
300b58b49b
@@ -104,7 +104,11 @@ struct arena_s {
|
|||||||
"Do not use this field directly. "
|
"Do not use this field directly. "
|
||||||
"Use `arena_get_bin` instead.")
|
"Use `arena_get_bin` instead.")
|
||||||
JEMALLOC_ALIGNED(CACHELINE)
|
JEMALLOC_ALIGNED(CACHELINE)
|
||||||
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
|
bin_t all_bins[];
|
||||||
|
#else
|
||||||
bin_t all_bins[0];
|
bin_t all_bins[0];
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_ARENA_STRUCTS_H */
|
#endif /* JEMALLOC_INTERNAL_ARENA_STRUCTS_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user