mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 06:22:25 +00:00
Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*.
This commit is contained in:
parent
90737e5677
commit
a865643d6c
215 changed files with 1441 additions and 1410 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
struct Heap__1 {
|
||||
|
|
@ -34,7 +34,7 @@ typedef
|
|||
typedef
|
||||
struct Heap_FinDesc {
|
||||
Heap_FinNode next;
|
||||
uintptr obj;
|
||||
address obj;
|
||||
BOOLEAN marked;
|
||||
Heap_Finalizer finalize;
|
||||
} Heap_FinDesc;
|
||||
|
|
@ -51,19 +51,19 @@ typedef
|
|||
Heap_ModuleName name;
|
||||
int32 refcnt;
|
||||
Heap_Cmd cmds;
|
||||
uintptr types;
|
||||
address types;
|
||||
Heap_EnumProc enumPtrs;
|
||||
int32 reserved1, reserved2;
|
||||
} Heap_ModuleDesc;
|
||||
|
||||
|
||||
export SYSTEM_PTR Heap_modules;
|
||||
static uintptr Heap_freeList[10];
|
||||
static uintptr Heap_bigBlocks;
|
||||
export uintptr Heap_allocated;
|
||||
static address Heap_freeList[10];
|
||||
static address Heap_bigBlocks;
|
||||
export address Heap_allocated;
|
||||
static BOOLEAN Heap_firstTry;
|
||||
static uintptr Heap_heap, Heap_heapend;
|
||||
export uintptr Heap_heapsize;
|
||||
static address Heap_heap, Heap_heapend;
|
||||
export address Heap_heapsize;
|
||||
static Heap_FinNode Heap_fin;
|
||||
static int16 Heap_lockdepth;
|
||||
static BOOLEAN Heap_interrupted;
|
||||
|
|
@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ;
|
|||
export LONGINT *Heap__1__typ;
|
||||
|
||||
static void Heap_CheckFin (void);
|
||||
static void Heap_ExtendHeap (uintptr blksz);
|
||||
static void Heap_ExtendHeap (address blksz);
|
||||
export void Heap_FINALL (void);
|
||||
static void Heap_Finalize (void);
|
||||
export void Heap_GC (BOOLEAN markStack);
|
||||
static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len);
|
||||
static void Heap_HeapSort (address n, address *a, LONGINT a__len);
|
||||
export void Heap_INCREF (Heap_Module m);
|
||||
export void Heap_InitHeap (void);
|
||||
export void Heap_Lock (void);
|
||||
static void Heap_Mark (uintptr q);
|
||||
static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len);
|
||||
static void Heap_Mark (address q);
|
||||
static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len);
|
||||
static void Heap_MarkP (SYSTEM_PTR p);
|
||||
static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len);
|
||||
export SYSTEM_PTR Heap_NEWBLK (uintptr size);
|
||||
export SYSTEM_PTR Heap_NEWREC (uintptr tag);
|
||||
static uintptr Heap_NewChunk (uintptr blksz);
|
||||
static void Heap_MarkStack (address n, address *cand, LONGINT cand__len);
|
||||
export SYSTEM_PTR Heap_NEWBLK (address size);
|
||||
export SYSTEM_PTR Heap_NEWREC (address tag);
|
||||
static address Heap_NewChunk (address blksz);
|
||||
export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
|
||||
export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
|
||||
export void Heap_REGTYP (Heap_Module m, uintptr typ);
|
||||
export void Heap_REGTYP (Heap_Module m, address typ);
|
||||
export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
|
||||
static void Heap_Scan (void);
|
||||
static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len);
|
||||
static void Heap_Sift (address l, address r, address *a, LONGINT a__len);
|
||||
export void Heap_Unlock (void);
|
||||
|
||||
extern void *Heap__init();
|
||||
extern uintptr Platform_MainStackFrame;
|
||||
extern uintptr Platform_OSAllocate(uintptr size);
|
||||
#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer)))
|
||||
extern address Platform_MainStackFrame;
|
||||
extern address Platform_OSAllocate(address size);
|
||||
#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer)))
|
||||
#define Heap_HeapModuleInit() Heap__init()
|
||||
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
||||
#define Heap_PlatformHalt(code) Platform_Halt(code)
|
||||
|
|
@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
|
|||
__COPY(name, m->name, 20);
|
||||
m->refcnt = 0;
|
||||
m->enumPtrs = enumPtrs;
|
||||
m->next = (Heap_Module)(uintptr)Heap_modules;
|
||||
m->next = (Heap_Module)(address)Heap_modules;
|
||||
Heap_modules = (SYSTEM_PTR)m;
|
||||
_o_result = (void*)m;
|
||||
return _o_result;
|
||||
|
|
@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
|
|||
m->cmds = c;
|
||||
}
|
||||
|
||||
void Heap_REGTYP (Heap_Module m, uintptr typ)
|
||||
void Heap_REGTYP (Heap_Module m, address typ)
|
||||
{
|
||||
__PUT(typ, m->types, uintptr);
|
||||
__PUT(typ, m->types, address);
|
||||
m->types = typ;
|
||||
}
|
||||
|
||||
|
|
@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m)
|
|||
m->refcnt += 1;
|
||||
}
|
||||
|
||||
static uintptr Heap_NewChunk (uintptr blksz)
|
||||
static address Heap_NewChunk (address blksz)
|
||||
{
|
||||
uintptr _o_result;
|
||||
uintptr chnk;
|
||||
address _o_result;
|
||||
address chnk;
|
||||
chnk = Heap_OSAllocate(blksz + 12);
|
||||
if (chnk != 0) {
|
||||
__PUT(chnk + 4, chnk + (12 + blksz), uintptr);
|
||||
__PUT(chnk + 12, chnk + 16, uintptr);
|
||||
__PUT(chnk + 16, blksz, uintptr);
|
||||
__PUT(chnk + 20, -4, uintptr);
|
||||
__PUT(chnk + 24, Heap_bigBlocks, uintptr);
|
||||
__PUT(chnk + 4, chnk + (12 + blksz), address);
|
||||
__PUT(chnk + 12, chnk + 16, address);
|
||||
__PUT(chnk + 16, blksz, address);
|
||||
__PUT(chnk + 20, -4, address);
|
||||
__PUT(chnk + 24, Heap_bigBlocks, address);
|
||||
Heap_bigBlocks = chnk + 12;
|
||||
Heap_heapsize += blksz;
|
||||
}
|
||||
|
|
@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz)
|
|||
return _o_result;
|
||||
}
|
||||
|
||||
static void Heap_ExtendHeap (uintptr blksz)
|
||||
static void Heap_ExtendHeap (address blksz)
|
||||
{
|
||||
uintptr size, chnk, j, next;
|
||||
address size, chnk, j, next;
|
||||
if (blksz > 160000) {
|
||||
size = blksz;
|
||||
} else {
|
||||
|
|
@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz)
|
|||
chnk = Heap_NewChunk(size);
|
||||
if (chnk != 0) {
|
||||
if (chnk < Heap_heap) {
|
||||
__PUT(chnk, Heap_heap, uintptr);
|
||||
__PUT(chnk, Heap_heap, address);
|
||||
Heap_heap = chnk;
|
||||
} else {
|
||||
j = Heap_heap;
|
||||
|
|
@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz)
|
|||
j = next;
|
||||
next = Heap_FetchAddress(j);
|
||||
}
|
||||
__PUT(chnk, next, uintptr);
|
||||
__PUT(j, chnk, uintptr);
|
||||
__PUT(chnk, next, address);
|
||||
__PUT(j, chnk, address);
|
||||
}
|
||||
if (next == 0) {
|
||||
Heap_heapend = Heap_FetchAddress(chnk + 4);
|
||||
|
|
@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz)
|
|||
}
|
||||
}
|
||||
|
||||
SYSTEM_PTR Heap_NEWREC (uintptr tag)
|
||||
SYSTEM_PTR Heap_NEWREC (address tag)
|
||||
{
|
||||
SYSTEM_PTR _o_result;
|
||||
uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev;
|
||||
address i, i0, di, blksz, restsize, t, adr, end, next, prev;
|
||||
SYSTEM_PTR new;
|
||||
Heap_Lock();
|
||||
blksz = Heap_FetchAddress(tag);
|
||||
|
|
@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag)
|
|||
di = i - i0;
|
||||
restsize = __ASHL(di, 4);
|
||||
end = adr + restsize;
|
||||
__PUT(end + 4, blksz, uintptr);
|
||||
__PUT(end + 8, -4, uintptr);
|
||||
__PUT(end, end + 4, uintptr);
|
||||
__PUT(adr + 4, restsize, uintptr);
|
||||
__PUT(adr + 12, Heap_freeList[di], uintptr);
|
||||
__PUT(end + 4, blksz, address);
|
||||
__PUT(end + 8, -4, address);
|
||||
__PUT(end, end + 4, address);
|
||||
__PUT(adr + 4, restsize, address);
|
||||
__PUT(adr + 12, Heap_freeList[di], address);
|
||||
Heap_freeList[di] = adr;
|
||||
adr += restsize;
|
||||
}
|
||||
|
|
@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag)
|
|||
}
|
||||
restsize = t - blksz;
|
||||
end = adr + restsize;
|
||||
__PUT(end + 4, blksz, uintptr);
|
||||
__PUT(end + 8, -4, uintptr);
|
||||
__PUT(end, end + 4, uintptr);
|
||||
__PUT(end + 4, blksz, address);
|
||||
__PUT(end + 8, -4, address);
|
||||
__PUT(end, end + 4, address);
|
||||
if (restsize > 144) {
|
||||
__PUT(adr + 4, restsize, uintptr);
|
||||
__PUT(adr + 4, restsize, address);
|
||||
} else {
|
||||
next = Heap_FetchAddress(adr + 12);
|
||||
if (prev == 0) {
|
||||
Heap_bigBlocks = next;
|
||||
} else {
|
||||
__PUT(prev + 12, next, uintptr);
|
||||
__PUT(prev + 12, next, address);
|
||||
}
|
||||
if (restsize > 0) {
|
||||
di = __ASHR(restsize, 4);
|
||||
__PUT(adr + 4, restsize, uintptr);
|
||||
__PUT(adr + 12, Heap_freeList[di], uintptr);
|
||||
__PUT(adr + 4, restsize, address);
|
||||
__PUT(adr + 12, Heap_freeList[di], address);
|
||||
Heap_freeList[di] = adr;
|
||||
}
|
||||
}
|
||||
|
|
@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag)
|
|||
i = adr + 16;
|
||||
end = adr + blksz;
|
||||
while (i < end) {
|
||||
__PUT(i, 0, uintptr);
|
||||
__PUT(i + 4, 0, uintptr);
|
||||
__PUT(i + 8, 0, uintptr);
|
||||
__PUT(i + 12, 0, uintptr);
|
||||
__PUT(i, 0, address);
|
||||
__PUT(i + 4, 0, address);
|
||||
__PUT(i + 8, 0, address);
|
||||
__PUT(i + 12, 0, address);
|
||||
i += 16;
|
||||
}
|
||||
__PUT(adr + 12, 0, uintptr);
|
||||
__PUT(adr, tag, uintptr);
|
||||
__PUT(adr + 4, 0, uintptr);
|
||||
__PUT(adr + 8, 0, uintptr);
|
||||
__PUT(adr + 12, 0, address);
|
||||
__PUT(adr, tag, address);
|
||||
__PUT(adr + 4, 0, address);
|
||||
__PUT(adr + 8, 0, address);
|
||||
Heap_allocated += blksz;
|
||||
Heap_Unlock();
|
||||
_o_result = (SYSTEM_PTR)(uintptr)(adr + 4);
|
||||
_o_result = (SYSTEM_PTR)(address)(adr + 4);
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
SYSTEM_PTR Heap_NEWBLK (uintptr size)
|
||||
SYSTEM_PTR Heap_NEWBLK (address size)
|
||||
{
|
||||
SYSTEM_PTR _o_result;
|
||||
uintptr blksz, tag;
|
||||
address blksz, tag;
|
||||
SYSTEM_PTR new;
|
||||
Heap_Lock();
|
||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||
new = Heap_NEWREC((uintptr)&blksz);
|
||||
tag = ((uintptr)(uintptr)new + blksz) - 12;
|
||||
__PUT(tag - 4, 0, uintptr);
|
||||
__PUT(tag, blksz, uintptr);
|
||||
__PUT(tag + 4, -4, uintptr);
|
||||
__PUT((uintptr)(uintptr)new - 4, tag, uintptr);
|
||||
new = Heap_NEWREC((address)&blksz);
|
||||
tag = ((address)(address)new + blksz) - 12;
|
||||
__PUT(tag - 4, 0, address);
|
||||
__PUT(tag, blksz, address);
|
||||
__PUT(tag + 4, -4, address);
|
||||
__PUT((address)(address)new - 4, tag, address);
|
||||
Heap_Unlock();
|
||||
_o_result = new;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
static void Heap_Mark (uintptr q)
|
||||
static void Heap_Mark (address q)
|
||||
{
|
||||
uintptr p, tag, offset, fld, n, tagbits;
|
||||
address p, tag, offset, fld, n, tagbits;
|
||||
if (q != 0) {
|
||||
tagbits = Heap_FetchAddress(q - 4);
|
||||
if (!__ODD(tagbits)) {
|
||||
__PUT(q - 4, tagbits + 1, uintptr);
|
||||
__PUT(q - 4, tagbits + 1, address);
|
||||
p = 0;
|
||||
tag = tagbits + 4;
|
||||
for (;;) {
|
||||
__GET(tag, offset, uintptr);
|
||||
if (__BIT((uintptr)&offset, 31)) {
|
||||
__PUT(q - 4, (tag + offset) + 1, uintptr);
|
||||
__GET(tag, offset, address);
|
||||
if (__BIT((address)&offset, 31)) {
|
||||
__PUT(q - 4, (tag + offset) + 1, address);
|
||||
if (p == 0) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q)
|
|||
q = p;
|
||||
tag = Heap_FetchAddress(q - 4);
|
||||
tag -= 1;
|
||||
__GET(tag, offset, uintptr);
|
||||
__GET(tag, offset, address);
|
||||
fld = q + offset;
|
||||
p = Heap_FetchAddress(fld);
|
||||
__PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR);
|
||||
__PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR);
|
||||
} else {
|
||||
fld = q + offset;
|
||||
n = Heap_FetchAddress(fld);
|
||||
if (n != 0) {
|
||||
tagbits = Heap_FetchAddress(n - 4);
|
||||
if (!__ODD(tagbits)) {
|
||||
__PUT(n - 4, tagbits + 1, uintptr);
|
||||
__PUT(q - 4, tag + 1, uintptr);
|
||||
__PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR);
|
||||
__PUT(n - 4, tagbits + 1, address);
|
||||
__PUT(q - 4, tag + 1, address);
|
||||
__PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR);
|
||||
p = q;
|
||||
q = n;
|
||||
tag = tagbits;
|
||||
|
|
@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q)
|
|||
|
||||
static void Heap_MarkP (SYSTEM_PTR p)
|
||||
{
|
||||
Heap_Mark((uintptr)(uintptr)p);
|
||||
Heap_Mark((address)(address)p);
|
||||
}
|
||||
|
||||
static void Heap_Scan (void)
|
||||
{
|
||||
uintptr chnk, adr, end, start, tag, i, size, freesize;
|
||||
address chnk, adr, end, start, tag, i, size, freesize;
|
||||
Heap_bigBlocks = 0;
|
||||
i = 1;
|
||||
while (i < 9) {
|
||||
|
|
@ -407,21 +407,21 @@ static void Heap_Scan (void)
|
|||
if (__ODD(tag)) {
|
||||
if (freesize > 0) {
|
||||
start = adr - freesize;
|
||||
__PUT(start, start + 4, uintptr);
|
||||
__PUT(start + 4, freesize, uintptr);
|
||||
__PUT(start + 8, -4, uintptr);
|
||||
__PUT(start, start + 4, address);
|
||||
__PUT(start + 4, freesize, address);
|
||||
__PUT(start + 8, -4, address);
|
||||
i = __ASHR(freesize, 4);
|
||||
freesize = 0;
|
||||
if (i < 9) {
|
||||
__PUT(start + 12, Heap_freeList[i], uintptr);
|
||||
__PUT(start + 12, Heap_freeList[i], address);
|
||||
Heap_freeList[i] = start;
|
||||
} else {
|
||||
__PUT(start + 12, Heap_bigBlocks, uintptr);
|
||||
__PUT(start + 12, Heap_bigBlocks, address);
|
||||
Heap_bigBlocks = start;
|
||||
}
|
||||
}
|
||||
tag -= 1;
|
||||
__PUT(adr, tag, uintptr);
|
||||
__PUT(adr, tag, address);
|
||||
size = Heap_FetchAddress(tag);
|
||||
Heap_allocated += size;
|
||||
adr += size;
|
||||
|
|
@ -433,16 +433,16 @@ static void Heap_Scan (void)
|
|||
}
|
||||
if (freesize > 0) {
|
||||
start = adr - freesize;
|
||||
__PUT(start, start + 4, uintptr);
|
||||
__PUT(start + 4, freesize, uintptr);
|
||||
__PUT(start + 8, -4, uintptr);
|
||||
__PUT(start, start + 4, address);
|
||||
__PUT(start + 4, freesize, address);
|
||||
__PUT(start + 8, -4, address);
|
||||
i = __ASHR(freesize, 4);
|
||||
freesize = 0;
|
||||
if (i < 9) {
|
||||
__PUT(start + 12, Heap_freeList[i], uintptr);
|
||||
__PUT(start + 12, Heap_freeList[i], address);
|
||||
Heap_freeList[i] = start;
|
||||
} else {
|
||||
__PUT(start + 12, Heap_bigBlocks, uintptr);
|
||||
__PUT(start + 12, Heap_bigBlocks, address);
|
||||
Heap_bigBlocks = start;
|
||||
}
|
||||
}
|
||||
|
|
@ -450,9 +450,9 @@ static void Heap_Scan (void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len)
|
||||
static void Heap_Sift (address l, address r, address *a, LONGINT a__len)
|
||||
{
|
||||
uintptr i, j, x;
|
||||
address i, j, x;
|
||||
j = l;
|
||||
x = a[j];
|
||||
for (;;) {
|
||||
|
|
@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len)
|
|||
a[i] = x;
|
||||
}
|
||||
|
||||
static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len)
|
||||
static void Heap_HeapSort (address n, address *a, LONGINT a__len)
|
||||
{
|
||||
uintptr l, r, x;
|
||||
address l, r, x;
|
||||
l = __ASHR(n, 1);
|
||||
r = n - 1;
|
||||
while (l > 0) {
|
||||
|
|
@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len)
|
|||
}
|
||||
}
|
||||
|
||||
static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len)
|
||||
static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len)
|
||||
{
|
||||
uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size;
|
||||
address chnk, adr, tag, next, lim, lim1, i, ptr, size;
|
||||
chnk = Heap_heap;
|
||||
i = 0;
|
||||
lim = cand[n - 1];
|
||||
|
|
@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len)
|
|||
static void Heap_CheckFin (void)
|
||||
{
|
||||
Heap_FinNode n;
|
||||
uintptr tag;
|
||||
address tag;
|
||||
n = Heap_fin;
|
||||
while (n != NIL) {
|
||||
tag = Heap_FetchAddress(n->obj - 4);
|
||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
|||
} else {
|
||||
prev->next = n->next;
|
||||
}
|
||||
(*n->finalize)((SYSTEM_PTR)(uintptr)n->obj);
|
||||
(*n->finalize)((SYSTEM_PTR)(address)n->obj);
|
||||
if (prev == NIL) {
|
||||
n = Heap_fin;
|
||||
} else {
|
||||
|
|
@ -572,14 +572,14 @@ void Heap_FINALL (void)
|
|||
while (Heap_fin != NIL) {
|
||||
n = Heap_fin;
|
||||
Heap_fin = Heap_fin->next;
|
||||
(*n->finalize)((SYSTEM_PTR)(uintptr)n->obj);
|
||||
(*n->finalize)((SYSTEM_PTR)(address)n->obj);
|
||||
}
|
||||
}
|
||||
|
||||
static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len)
|
||||
static void Heap_MarkStack (address n, address *cand, LONGINT cand__len)
|
||||
{
|
||||
SYSTEM_PTR frame;
|
||||
uintptr inc, nofcand, sp, p, stack0;
|
||||
address inc, nofcand, sp, p, stack0;
|
||||
struct Heap__1 align;
|
||||
if (n > 0) {
|
||||
Heap_MarkStack(n - 1, cand, cand__len);
|
||||
|
|
@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len)
|
|||
}
|
||||
if (n == 0) {
|
||||
nofcand = 0;
|
||||
sp = (uintptr)&frame;
|
||||
sp = (address)&frame;
|
||||
stack0 = Heap_PlatformMainStackFrame();
|
||||
inc = (uintptr)&align.p - (uintptr)&align;
|
||||
inc = (address)&align.p - (address)&align;
|
||||
if (sp > stack0) {
|
||||
inc = -inc;
|
||||
}
|
||||
while (sp != stack0) {
|
||||
__GET(sp, p, uintptr);
|
||||
__GET(sp, p, address);
|
||||
if ((p > Heap_heap && p < Heap_heapend)) {
|
||||
if (nofcand == cand__len) {
|
||||
Heap_HeapSort(nofcand, (void*)cand, cand__len);
|
||||
|
|
@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len)
|
|||
void Heap_GC (BOOLEAN markStack)
|
||||
{
|
||||
Heap_Module m;
|
||||
uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
|
||||
uintptr cand[10000];
|
||||
address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
|
||||
address cand[10000];
|
||||
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
||||
Heap_Lock();
|
||||
m = (Heap_Module)(uintptr)Heap_modules;
|
||||
m = (Heap_Module)(address)Heap_modules;
|
||||
while (m != NIL) {
|
||||
if (m->enumPtrs != NIL) {
|
||||
(*m->enumPtrs)(Heap_MarkP);
|
||||
|
|
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
|
|||
{
|
||||
Heap_FinNode f;
|
||||
__NEW(f, Heap_FinDesc);
|
||||
f->obj = (uintptr)(uintptr)obj;
|
||||
f->obj = (address)(address)obj;
|
||||
f->finalize = finalize;
|
||||
f->marked = 1;
|
||||
f->next = Heap_fin;
|
||||
|
|
@ -710,7 +710,7 @@ void Heap_InitHeap (void)
|
|||
{
|
||||
Heap_heap = Heap_NewChunk(128000);
|
||||
Heap_heapend = Heap_FetchAddress(Heap_heap + 4);
|
||||
__PUT(Heap_heap, 0, uintptr);
|
||||
__PUT(Heap_heap, 0, address);
|
||||
Heap_allocated = 0;
|
||||
Heap_firstTry = 1;
|
||||
Heap_freeList[9] = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue