mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
Only enforce allocator initialization if the option is set
This commit is contained in:
parent
d79cf9ae5a
commit
bd29c77d32
1 changed files with 2 additions and 0 deletions
|
@ -1043,9 +1043,11 @@ static inline bool is_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void enforce_init(void) {
|
static inline void enforce_init(void) {
|
||||||
|
#if CONFIG_ENFORCE_INIT
|
||||||
if (!is_init()) {
|
if (!is_init()) {
|
||||||
fatal_error("invalid uninitialized allocator usage");
|
fatal_error("invalid uninitialized allocator usage");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
COLD static void init_slow_path(void) {
|
COLD static void init_slow_path(void) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue