diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-04-11 05:03:49 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-04-11 05:03:49 +0200 |
commit | 1b8a56941708e6fe884f4649f718fae7c543c045 (patch) | |
tree | 3d7be0a7e43b01aba6dd986bff06bcc3947a6d78 /sys/src/cmd/1l/obj.c | |
parent | 9d46360c9d83fa95f42f1eebbad49ecd9281fb0d (diff) |
cc, ?[acl]: fix gethunk() and move common memory allocator code to cc/compat
for gethunk() to work, all allocators have to use it,
including allocations done by libc thru malloc(),
so the fake allocation functions are mandatory for
everyone.
to avoid duplication the code is moved to cc/compat
and prototypes provided in new cc/compat.h header.
Diffstat (limited to 'sys/src/cmd/1l/obj.c')
-rw-r--r-- | sys/src/cmd/1l/obj.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/sys/src/cmd/1l/obj.c b/sys/src/cmd/1l/obj.c index 9cc82a56e..094e17101 100644 --- a/sys/src/cmd/1l/obj.c +++ b/sys/src/cmd/1l/obj.c @@ -1083,28 +1083,6 @@ copyp(Prog *q) } void -gethunk(void) -{ - char *h; - long nh; - - nh = NHUNK; - if(thunk >= 5L*NHUNK) { - nh = 5L*NHUNK; - if(thunk >= 25L*NHUNK) - nh = 25L*NHUNK; - } - h = mysbrk(nh); - if(h == (char*)-1) { - diag("out of memory"); - errorexit(); - } - hunk = h; - nhunk = nh; - thunk += nh; -} - -void doprof1(void) { Sym *s; |