mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Implement swapcontext() and makecontext()
This change introduces support for Linux-style uc_context manipulation that's fast and works well on all supported OSes and architectures. It also integrates with the Cosmpolitan runtime which can show backtraces comprised of multiple stacks and fibers. See the test and example code for further details. This will be used by Mold once it's been vendored
This commit is contained in:
parent
7ec84655b4
commit
197aa0d465
28 changed files with 617 additions and 355 deletions
|
@ -26,7 +26,6 @@ char *strndup(const char *, size_t) paramsnonnull() mallocesque;
|
|||
void *aligned_alloc(size_t, size_t) attributeallocalign((1))
|
||||
attributeallocsize((2)) returnspointerwithnoaliases libcesque dontdiscard;
|
||||
int posix_memalign(void **, size_t, size_t);
|
||||
bool __grow(void *, size_t *, size_t, size_t) paramsnonnull((1, 2)) libcesque;
|
||||
|
||||
int mallopt(int, int);
|
||||
int malloc_trim(size_t);
|
||||
|
@ -59,6 +58,10 @@ size_t malloc_set_footprint_limit(size_t);
|
|||
void malloc_inspect_all(void (*handler)(void *, void *, size_t, void *),
|
||||
void *);
|
||||
|
||||
#ifdef COSMO
|
||||
bool __grow(void *, size_t *, size_t, size_t) paramsnonnull((1, 2)) libcesque;
|
||||
#endif
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_MEM_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue