cosmopolitan/libc/runtime/brk.internal.h
Justine Tunney 5005f2e446
Rewrite brk() and sbrk()
This change reduces the .bss memory requirement for all executables by
O(64kb). The brk system calls are now fully tested and figured out and
might be useful for tiny programs that only target System Five.
2022-10-01 23:11:56 -07:00

16 lines
399 B
C

#ifndef COSMOPOLITAN_LIBC_RUNTIME_BRK_INTERNAL_H_
#define COSMOPOLITAN_LIBC_RUNTIME_BRK_INTERNAL_H_
#include "libc/thread/thread.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct Brk {
unsigned char *p;
pthread_mutex_t m;
};
extern struct Brk __brk;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_RUNTIME_BRK_INTERNAL_H_ */