summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-12 21:03:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-12 21:03:42 -0700
commit146229666d039720e5ee56d21b8e937abc23f18a (patch)
tree890de2470a4eabdec8e6bc91a697cbe91648e8d6 /gc.c
parentfffdf3f4287dd8636657969a7e39e5a544cdb885 (diff)
downloadtxr-146229666d039720e5ee56d21b8e937abc23f18a.tar.gz
txr-146229666d039720e5ee56d21b8e937abc23f18a.tar.bz2
txr-146229666d039720e5ee56d21b8e937abc23f18a.zip
gc: use symbolic constants for special vec slots.
* gc.c (mark_obj): The vector alloc size and length which lie at negative indices should be accessed using the index constants vec_alloc and vec_length, rather than -2 and -1.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index e42e7552..dea37403 100644
--- a/gc.c
+++ b/gc.c
@@ -371,12 +371,12 @@ tail_call:
return;
case VEC:
{
- val alloc_size = obj->v.vec[-2];
- val fill_ptr = obj->v.vec[-1];
- cnum i, fp = c_num(fill_ptr);
+ val alloc_size = obj->v.vec[vec_alloc];
+ val len = obj->v.vec[vec_length];
+ cnum i, fp = c_num(len);
mark_obj(alloc_size);
- mark_obj(fill_ptr);
+ mark_obj(len);
for (i = 0; i < fp; i++)
mark_obj(obj->v.vec[i]);