summaryrefslogtreecommitdiff
path: root/as
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2002-07-22 23:35:31 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:47 +0200
commit673f690a37f6673a3262e933709c79de8a66f48c (patch)
tree3acd007863bf23ce8549f9edb5e51d23a3bc6078 /as
parent352e3b3230dfc6746be6d53325ffe1e33efc5289 (diff)
downloaddev86-673f690a37f6673a3262e933709c79de8a66f48c.tar.gz
Import Dev86src-0.16.4.tar.gzv0.16.4
Diffstat (limited to 'as')
-rw-r--r--as/alloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/as/alloc.c b/as/alloc.c
index 6f64ccc..b4e94fc 100644
--- a/as/alloc.c
+++ b/as/alloc.c
@@ -20,12 +20,13 @@ init_heap()
{
#ifdef USE_FIXED_HEAP
#ifndef USERMEM
-#define USERMEM (unsigned) 0xAC00U
+#define USERMEM 0xAC00U
#endif
#ifdef __AS386_16__
+ int stk;
heapptr = sbrk(0);
- heapend = ((char*)&argc) - STAKSIZ - 16;
+ heapend = ((char*)&stk) - STAKSIZ - 16;
brk(heapend);
if(sbrk(0) != heapend)
as_abort(NOMEMEORY);
@@ -68,8 +69,7 @@ unsigned int size;
#else
rv = malloc(size);
#endif
-
- if (rv == 0) as_abort(NOMEMEORY);
+ if (rv == 0 && size) as_abort(NOMEMEORY);
return rv;
}
@@ -85,7 +85,7 @@ unsigned int size;
if ((char*)oldptr+size < heapend)
{
- heapptr = oldptr + size;
+ heapptr = (char*)oldptr + size;
rv = oldptr;
}
else