Skip to content

Commit 0a6f8ac

Browse files
committed
Replaces scaling factor 2 for array length offsets by DLWORDSPER_CELL as that is what it represents.
1 parent fc90838 commit 0a6f8ac

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/gcfinal.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#endif /* NEVER */
7070

7171
#define min(a, b) (((a) > (b)) ? (b) : (a))
72-
#define Trailer(ldatum, datum68) ((ldatum) + 2 * ((datum68)->arlen - ARRAYBLOCKTRAILERCELLS))
72+
#define Trailer(ldatum, datum68) ((ldatum) + DLWORDSPER_CELL * ((datum68)->arlen - ARRAYBLOCKTRAILERCELLS))
7373
#define BucketIndex(n) min(integerlength(n), MAXBUCKETINDEX)
7474
#define FreeBlockChainN(n) ((POINTERMASK & *FreeBlockBuckets_word) + 2 * BucketIndex(n))
7575

@@ -367,7 +367,7 @@ LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
367367
* (3) creating a max size block leaves a non-viable leftover block
368368
* move the boundary to make a big block and a minimum size leftover block
369369
*/
370-
if (base + (2 * arlens) != nbase) {
370+
if (base + (DLWORDSPER_CELL * arlens) != nbase) {
371371
error("Attempt to merge non-adjacent blocks in array space\n");
372372
}
373373
if (narlens > secondbite) { /* (2) or (3) */
@@ -381,7 +381,7 @@ LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
381381
arlens += shaveback;
382382
secondbite += shaveback;
383383
}
384-
linkblock(makefreearrayblock(nbase + 2 * secondbite, narlens));
384+
linkblock(makefreearrayblock(nbase + DLWORDSPER_CELL * secondbite, narlens));
385385
narlens = 0;
386386
}
387387
return (linkblock(makefreearrayblock(base, arlens + narlens)));
@@ -405,7 +405,7 @@ LispPTR mergebackward(LispPTR base) {
405405
if ((*ArrayMerging_word == NIL) ||
406406
((base == *ArraySpace_word) || ((base == *ArraySpace2_word) || (ptrailer->inuse == T))))
407407
return (linkblock(base));
408-
pbase = base - 2 * ptrailer->arlen;
408+
pbase = base - DLWORDSPER_CELL * ptrailer->arlen;
409409
checkarrayblock(pbase, T, NIL);
410410
deleteblock(pbase);
411411
return (arrayblockmerger(pbase, base));
@@ -427,7 +427,7 @@ LispPTR mergeforward(LispPTR base) {
427427
if (checkarrayblock(base, T, T)) return NIL;
428428

429429
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
430-
nbase = base + 2 * (bbase->arlen);
430+
nbase = base + DLWORDSPER_CELL * (bbase->arlen);
431431
if (nbase == *ArrayFrLst_word || nbase == *ArrayFrLst2_word) return NIL;
432432

433433
bnbase = (struct arrayblock *)NativeAligned4FromLAddr(nbase);
@@ -487,7 +487,7 @@ LispPTR reclaimarrayblock(LispPTR ptr) {
487487

488488
switch (base->gctype) {
489489
case PTRBLOCK_GCT: {
490-
btrailer = (ptr - 2) + 2 * (base->arlen - ARRAYBLOCKTRAILERCELLS);
490+
btrailer = (ptr - 2) + DLWORDSPER_CELL * (base->arlen - ARRAYBLOCKTRAILERCELLS);
491491
tmpptr = ptr;
492492
do {
493493
tmpp = (LispPTR *)NativeAligned4FromLAddr(tmpptr);
@@ -545,8 +545,8 @@ void printarrayblock(LispPTR base) {
545545
btrailer = (struct arrayblock *)NativeAligned4FromLAddr(Trailer(base, bbase));
546546
ptrailer = (struct arrayblock *)NativeAligned4FromLAddr(base - ARRAYBLOCKTRAILERWORDS);
547547

548-
nbase = base + 2 * bbase->arlen;
549-
pbase = base - 2 * ptrailer->arlen;
548+
nbase = base + DLWORDSPER_CELL * bbase->arlen;
549+
pbase = base - DLWORDSPER_CELL * ptrailer->arlen;
550550

551551
printf("This array block: 0x%x. Previous: 0x%x. Next: 0x%x.\n", base, pbase, nbase);
552552
printf(" Length: %d cells.\n\n", bbase->arlen);

0 commit comments

Comments
 (0)