Remove fake malloc.
[jmk] --rw-rw-r-- M 23513 jmk sys 445 Dec 10 19:39 sys/src/cmd/7l/compat.c
[jmk] --rwxrwxr-- M 23513 glenda sys 5002 Dec 10 19:39 sys/src/cmd/7l/l.h
/n/sourcesdump/2005/1210/plan9/sys/src/cmd/7l/l.h:286,291 -
/n/sourcesdump/2005/1211/plan9/sys/src/cmd/7l/l.h:286,292
void lput(long);
void lputbe(long);
void mkfwd(void);
+ void* mysbrk(ulong);
void names(void);
void nocache(Prog*);
void noops(void);
[jmk] --rwxrwxr-- M 23513 glenda sys 372 Dec 10 19:39 sys/src/cmd/7l/mkfile
/n/sourcesdump/2005/1210/plan9/sys/src/cmd/7l/mkfile:11,16 -
/n/sourcesdump/2005/1211/plan9/sys/src/cmd/7l/mkfile:11,17
sched.$O\
span.$O\
enam.$O\
+ compat.$O\
HFILES=\
l.h\
[jmk] --rwxrwxr-- M 23513 glenda sys 22824 Dec 10 19:39 sys/src/cmd/7l/obj.c
/n/sourcesdump/2005/1210/plan9/sys/src/cmd/7l/obj.c:1032,1038 -
/n/sourcesdump/2005/1211/plan9/sys/src/cmd/7l/obj.c:1032,1038
if(thunk >= 25L*NHUNK)
nh = 25L*NHUNK;
}
- h = sbrk(nh);
+ h = mysbrk(nh);
if(h == (char*)-1) {
diag("out of memory");
errorexit();
/n/sourcesdump/2005/1210/plan9/sys/src/cmd/7l/obj.c:1316,1362 -
/n/sourcesdump/2005/1211/plan9/sys/src/cmd/7l/obj.c:1316,1319
exp = (ieee->h>>20) & ((1L<<11)-1L);
exp -= (1L<<10) - 2L;
return ldexp(fr, exp);
- }
-
- /*
- * fake malloc
- */
- void*
- malloc(ulong n)
- {
- void *p;
-
- while(n & 7)
- n++;
- while(nhunk < n)
- gethunk();
- p = hunk;
- nhunk -= n;
- hunk += n;
- return p;
- }
-
- void
- free(void *p)
- {
- USED(p);
- }
-
- void*
- calloc(ulong m, ulong n)
- {
- void *p;
-
- n *= m;
- p = malloc(n);
- memset(p, 0, n);
- return p;
- }
-
- void*
- realloc(void*, ulong)
- {
- fprint(2, "realloc called\n");
- abort();
- return 0;
}
|