Remove unused variable and export. Thanks Oleg.

This commit is contained in:
David Brown 2016-07-22 18:56:14 +01:00
parent d9c319ef3a
commit 6d957bf0bb
2 changed files with 9 additions and 10 deletions

View file

@ -3,7 +3,7 @@ MODULE Heap;
IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete
before any other modules are initialized. *) before any other modules are initialized. *)
CONST CONST
ModNameLen = 20; ModNameLen = 20;
CmdNameLen = 24; CmdNameLen = 24;
SZL = SIZE(LONGINT); SZL = SIZE(LONGINT);
@ -124,8 +124,8 @@ MODULE Heap;
VAR m: Module; VAR m: Module;
BEGIN BEGIN
(* REGMOD is called at the start of module initialisation code before that modules (* REGMOD is called at the start of module initialisation code before that modules
type descriptors have been set up. 'NEW' depends on the Heap modules type type descriptors have been set up. 'NEW' depends on the Heap modules type
descriptors being ready for use, therefore, just for the Heap module itself, we descriptors being ready for use, therefore, just for the Heap module itself, we
must use SYSTEM.NEW. *) must use SYSTEM.NEW. *)
IF name = "Heap" THEN IF name = "Heap" THEN
SYSTEM.NEW(m, SIZE(ModuleDesc)) SYSTEM.NEW(m, SIZE(ModuleDesc))
@ -142,7 +142,7 @@ MODULE Heap;
VAR c: Cmd; VAR c: Cmd;
BEGIN BEGIN
(* REGCMD is called during module initialisation code before that modules (* REGCMD is called during module initialisation code before that modules
type descriptors have been set up. 'NEW' depends on the Heap modules type type descriptors have been set up. 'NEW' depends on the Heap modules type
descriptors being ready for use, therefore, just for the commands registered descriptors being ready for use, therefore, just for the commands registered
by the Heap module itself, we must use SYSTEM.NEW. *) by the Heap module itself, we must use SYSTEM.NEW. *)
IF m.name = "Heap" THEN IF m.name = "Heap" THEN
@ -184,7 +184,7 @@ MODULE Heap;
(* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works
correctly regardless of the size of an address. Specifically on 32 bit address correctly regardless of the size of an address. Specifically on 32 bit address
architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT
rather than loading 64 bits. *) rather than loading 64 bits. *)
PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))"; PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))";
@ -455,7 +455,7 @@ MODULE Heap;
PROCEDURE CheckFin; PROCEDURE CheckFin;
VAR n: FinNode; tag: LONGINT; VAR n: FinNode; tag: LONGINT;
BEGIN BEGIN
n := fin; n := fin;
WHILE n # NIL DO WHILE n # NIL DO
tag := FetchAddress(n.obj - SZL); tag := FetchAddress(n.obj - SZL);
@ -475,7 +475,7 @@ MODULE Heap;
n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj));
(* new nodes may have been pushed in n.finalize, therefore: *) (* new nodes may have been pushed in n.finalize, therefore: *)
IF prev = NIL THEN n := fin ELSE n := n.next END IF prev = NIL THEN n := fin ELSE n := n.next END
ELSE ELSE
prev := n; n := n.next prev := n; n := n.next
END END
END END
@ -497,7 +497,7 @@ MODULE Heap;
VAR VAR
frame: SYSTEM.PTR; frame: SYSTEM.PTR;
inc, nofcand: LONGINT; inc, nofcand: LONGINT;
sp, p, stack0, ptr: LONGINT; sp, p, stack0: LONGINT;
align: RECORD ch: CHAR; p: SYSTEM.PTR END ; align: RECORD ch: CHAR; p: SYSTEM.PTR END ;
BEGIN BEGIN
IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *)
@ -560,7 +560,7 @@ MODULE Heap;
PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer);
VAR f: FinNode; VAR f: FinNode;
BEGIN NEW(f); BEGIN NEW(f);
f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE;
f.next := fin; fin := f; f.next := fin; fin := f;
END RegisterFinalizer; END RegisterFinalizer;

View file

@ -209,7 +209,6 @@ extern void Heap_INCREF();
// Main module initialisation, registration and finalisation // Main module initialisation, registration and finalisation
extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Platform_Init(INTEGER argc, LONGINT argv);
extern void *Platform_MainModule;
extern void Heap_FINALL(); extern void Heap_FINALL();
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv);