mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Remove some legacy cruft
Function trace logs will report stack usage accurately. It won't include the argv/environ block. Our clone() polyfill is now simpler and does not use as much stack memory. Function call tracing on x86 is now faster too
This commit is contained in:
parent
8db646f6b2
commit
a15958edc6
21 changed files with 291 additions and 467 deletions
|
@ -44,7 +44,7 @@
|
|||
|
||||
#define STACK_SIZE 65536
|
||||
|
||||
static textwindows dontinstrument uint32_t __itimer_worker(void *arg) {
|
||||
textwindows dontinstrument static uint32_t __itimer_worker(void *arg) {
|
||||
struct CosmoTib tls;
|
||||
char *sp = __builtin_frame_address(0);
|
||||
__bootstrap_tls(&tls, sp);
|
||||
|
@ -87,7 +87,7 @@ static textwindows dontinstrument uint32_t __itimer_worker(void *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static textwindows void __itimer_setup(void) {
|
||||
textwindows static void __itimer_setup(void) {
|
||||
__itimer.thread = CreateThread(0, STACK_SIZE, __itimer_worker, 0,
|
||||
kNtStackSizeParamIsAReservation, 0);
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ void _pthread_decimate(enum PosixThreadStatus threshold) {
|
|||
}
|
||||
}
|
||||
|
||||
dontinstrument static int PosixThread(void *arg, int tid) {
|
||||
static int PosixThread(void *arg) {
|
||||
struct PosixThread *pt = arg;
|
||||
|
||||
// setup scheduling
|
||||
|
@ -162,11 +162,11 @@ dontinstrument static int PosixThread(void *arg, int tid) {
|
|||
|
||||
// setup signal stack
|
||||
if (pt->pt_attr.__sigaltstacksize) {
|
||||
struct sigaltstack ss;
|
||||
ss.ss_sp = pt->pt_attr.__sigaltstackaddr;
|
||||
ss.ss_size = pt->pt_attr.__sigaltstacksize;
|
||||
ss.ss_flags = 0;
|
||||
unassert(!sigaltstack(&ss, 0));
|
||||
struct sigaltstack *ss = alloca(sizeof(struct sigaltstack));
|
||||
ss->ss_sp = pt->pt_attr.__sigaltstackaddr;
|
||||
ss->ss_size = pt->pt_attr.__sigaltstacksize;
|
||||
ss->ss_flags = 0;
|
||||
unassert(!sigaltstack(ss, 0));
|
||||
}
|
||||
|
||||
// set long jump handler so pthread_exit can bring control back here
|
||||
|
|
|
@ -10,7 +10,6 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
struct CosmoFtrace { /* 16 */
|
||||
char ft_once; /* 0 */
|
||||
char ft_noreentry; /* 1 */
|
||||
int ft_skew; /* 4 */
|
||||
int64_t ft_lastaddr; /* 8 */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue