1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00
serenity/Userland/Libraries/LibC/sys/internals.h
Jean-Baptiste Boric 8043fcd466 LibC: Don't format strings when asserting with an unstable heap
If we hit an assertion while the heap isn't in a stable state, we can't
rely on dynamic memory allocation because the malloc mutex is already
held and the heap is most likely corrupted. Instead, we need to bail
out fast before we make the situation even worse.
2021-09-18 01:35:11 +00:00

29 lines
720 B
C

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <sys/cdefs.h>
__BEGIN_DECLS
typedef void (*AtExitFunction)(void*);
extern void __libc_init();
extern void __malloc_init();
extern void __stdio_init();
extern void _init();
extern bool __environ_is_malloced;
extern bool __stdio_is_initialized;
extern bool __heap_is_stable;
int __cxa_atexit(AtExitFunction exit_function, void* parameter, void* dso_handle);
void __cxa_finalize(void* dso_handle);
__attribute__((noreturn)) void __cxa_pure_virtual() __attribute__((weak));
__attribute__((noreturn)) void __stack_chk_fail();
__attribute__((noreturn)) void __stack_chk_fail_local();
__END_DECLS