mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 15:42:25 +00:00
Replace uses of uintptr_t and size_t with SYSTEM_ADDRESS.
This commit is contained in:
parent
3c36cbd111
commit
3744c3d0ae
211 changed files with 646 additions and 688 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
struct Heap__1 {
|
||||
|
|
@ -101,7 +101,7 @@ export void Heap_Unlock (void);
|
|||
extern void *Heap__init();
|
||||
extern LONGINT Platform_MainStackFrame;
|
||||
extern LONGINT Platform_OSAllocate(LONGINT size);
|
||||
#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))
|
||||
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_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, ((LONGINT)(20)));
|
||||
m->refcnt = 0;
|
||||
m->enumPtrs = enumPtrs;
|
||||
m->next = (Heap_Module)(uintptr_t)Heap_modules;
|
||||
m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||
Heap_modules = (SYSTEM_PTR)m;
|
||||
_o_result = (void*)m;
|
||||
return _o_result;
|
||||
|
|
@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag)
|
|||
__PUT(adr + 8, 0, LONGINT);
|
||||
Heap_allocated += blksz;
|
||||
Heap_Unlock();
|
||||
_o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4);
|
||||
_o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4);
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
|
|
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
|||
SYSTEM_PTR new;
|
||||
Heap_Lock();
|
||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||
new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz);
|
||||
tag = ((LONGINT)(uintptr_t)new + blksz) - 12;
|
||||
new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz);
|
||||
tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12;
|
||||
__PUT(tag - 4, 0, LONGINT);
|
||||
__PUT(tag, blksz, LONGINT);
|
||||
__PUT(tag + 4, -4, LONGINT);
|
||||
__PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT);
|
||||
__PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT);
|
||||
Heap_Unlock();
|
||||
_o_result = new;
|
||||
return _o_result;
|
||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
|||
__GET(tag, offset, LONGINT);
|
||||
fld = q + offset;
|
||||
p = Heap_FetchAddress(fld);
|
||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR);
|
||||
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR);
|
||||
} else {
|
||||
fld = q + offset;
|
||||
n = Heap_FetchAddress(fld);
|
||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
|||
if (!__ODD(tagbits)) {
|
||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||
__PUT(q - 4, tag + 1, LONGINT);
|
||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR);
|
||||
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR);
|
||||
p = q;
|
||||
q = n;
|
||||
tag = tagbits;
|
||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
|||
|
||||
static void Heap_MarkP (SYSTEM_PTR p)
|
||||
{
|
||||
Heap_Mark((LONGINT)(uintptr_t)p);
|
||||
Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p);
|
||||
}
|
||||
|
||||
static void Heap_Scan (void)
|
||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
|||
} else {
|
||||
prev->next = n->next;
|
||||
}
|
||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
||||
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||
if (prev == NIL) {
|
||||
n = Heap_fin;
|
||||
} else {
|
||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
|||
while (Heap_fin != NIL) {
|
||||
n = Heap_fin;
|
||||
Heap_fin = Heap_fin->next;
|
||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
||||
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
|
|||
}
|
||||
if (n == 0) {
|
||||
nofcand = 0;
|
||||
sp = (LONGINT)(uintptr_t)&frame;
|
||||
sp = (LONGINT)(SYSTEM_ADDRESS)&frame;
|
||||
stack0 = Heap_PlatformMainStackFrame();
|
||||
inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align;
|
||||
inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align;
|
||||
if (sp > stack0) {
|
||||
inc = -inc;
|
||||
}
|
||||
|
|
@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack)
|
|||
LONGINT cand[10000];
|
||||
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
||||
Heap_Lock();
|
||||
m = (Heap_Module)(uintptr_t)Heap_modules;
|
||||
m = (Heap_Module)(SYSTEM_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 = (LONGINT)(uintptr_t)obj;
|
||||
f->obj = (LONGINT)(SYSTEM_ADDRESS)obj;
|
||||
f->finalize = finalize;
|
||||
f->marked = 1;
|
||||
f->next = Heap_fin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue