diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-08-17 17:38:46 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-08-17 17:38:46 +0000 |
commit | 91f79ce9fab7c9920b6f331ca074d58c17755fc9 (patch) | |
tree | 66d35f064131f18746042a05773ca1ab61e29fa9 /sys/src/9/port/sysproc.c | |
parent | c8e25d2a18c0395431abc5818a1d2f0561b0181f (diff) |
kernel: allocate notes in heap
de-bloat the proc structure by allocating notes
with on the heap instead of embedding them in
the proc structure.
This saves around 640 bytes per process.
Diffstat (limited to 'sys/src/9/port/sysproc.c')
-rw-r--r-- | sys/src/9/port/sysproc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c index cd1e641cb..16bcf90a1 100644 --- a/sys/src/9/port/sysproc.c +++ b/sys/src/9/port/sysproc.c @@ -105,12 +105,12 @@ sysrfork(va_list list) p->dot = up->dot; incref(p->dot); - memmove(p->note, up->note, sizeof(p->note)); - p->nnote = up->nnote; - p->notify = up->notify; + p->nnote = 0; + p->notify = up->notify; p->notified = 0; p->notepending = 0; - p->lastnote = up->lastnote; + p->lastnote = nil; + if((flag & RFNOTEG) == 0) p->noteid = up->noteid; @@ -599,7 +599,9 @@ sysexec(va_list list) up->nargs = n; up->setargs = 0; - up->nnote = 0; + freenotes(up); + free(up->lastnote); + up->lastnote = nil; up->notify = nil; up->notified = 0; up->privatemem = 0; |