mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Add malloc logging tool
STATIC_YOINK("enable_memory_log");
This commit is contained in:
parent
7e9fb0a9f1
commit
cb67223051
25 changed files with 502 additions and 78 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/setjmp.internal.h"
|
||||
#include "libc/nexgen32e/threaded.h"
|
||||
#include "libc/nt/thread.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
|
@ -32,8 +33,13 @@
|
|||
* @noreturn
|
||||
*/
|
||||
privileged wontreturn void _Exit1(int rc) {
|
||||
jmp_buf *jb;
|
||||
struct WinThread *wt;
|
||||
STRACE("_Exit1(%d)", rc);
|
||||
if (__tls_enabled) {
|
||||
jb = (jmp_buf *)(__get_tls() + 0x08);
|
||||
longjmp(*jb, rc);
|
||||
}
|
||||
if (!IsWindows() && !IsMetal()) {
|
||||
asm volatile("xor\t%%r10d,%%r10d\n\t"
|
||||
"syscall"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue