1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-06 02:59:14 +00:00

Cleans up and makes static arrayblockmerger implementation

Uses consistent naming (_np) for native pointer equivalents of Lisp
    addresses
This commit is contained in:
Nick Briggs
2025-07-19 12:26:29 -07:00
parent 93b3a709c9
commit 2c46a9473a
2 changed files with 7 additions and 8 deletions

View File

@@ -5,7 +5,6 @@ void printarrayblock(LispPTR base);
LispPTR releasingvmempage(LispPTR ptr);
LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist);
LispPTR makefreearrayblock(LispPTR block, DLword length);
LispPTR arrayblockmerger(LispPTR base, LispPTR nbase);
LispPTR mergebackward(LispPTR base);
LispPTR mergeforward(LispPTR base);
LispPTR reclaimarrayblock(LispPTR ptr);

View File

@@ -51,7 +51,7 @@
#include "gccodedefs.h" // for reclaimcodeblock
#include "gcdata.h" // for DELREF, REC_GCLOOKUP
#include "gchtfinddefs.h" // for htfind, rec_htfind
#include "gcfinaldefs.h" // for arrayblockmerger, checkarrayblock
#include "gcfinaldefs.h" // for checkarrayblock
#include "lispemul.h" // for LispPTR, NIL, T, POINTERMASK, DLword, ATOM_T
#include "llstkdefs.h" // for decusecount68k
#include "lspglob.h" // for FreeBlockBuckets_word, ArrayMerging_word
@@ -374,13 +374,13 @@ LispPTR makefreearrayblock(LispPTR block, DLword length) {
/* */
/* */
/************************************************************************/
LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
static LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
DLword arlens, narlens, secondbite, minblocksize, shaveback;
struct arrayblock *bbase, *bnbase;
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
bnbase = (struct arrayblock *)NativeAligned4FromLAddr(nbase);
arlens = bbase->arlen;
narlens = bnbase->arlen;
struct arrayblock *base_np, *nbase_np;
base_np = (struct arrayblock *)NativeAligned4FromLAddr(base);
nbase_np = (struct arrayblock *)NativeAligned4FromLAddr(nbase);
arlens = base_np->arlen;
narlens = nbase_np->arlen;
secondbite = MAXARRAYBLOCKSIZE - arlens;
/* There are three cases for merging the blocks
* (1) the total size of the two blocks is less than max: