From bbc7d34f8cbaf3ec24ee6d95aad1e8c58ab4d531 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Thu, 1 Jan 2009 21:47:48 -0500 Subject: [PATCH] Make gc_handle a non-pointer type and fix some tagging bugs. --- gc.c | 2 +- gc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gc.c b/gc.c index 1beefe8..538a53a 100644 --- a/gc.c +++ b/gc.c @@ -231,7 +231,7 @@ void gc_relocate(gc_handle *v) { reloc = _gc_alloc(len); memcpy(reloc, val, sizeof(uintptr_t) * len); val->ops = BROKEN_HEART; - *v = val->data[0] = reloc; + *v = val->data[0] = TAG_POINTER(reloc); } void gc_relocate_root() { diff --git a/gc.h b/gc.h index 9b72b29..ae256ba 100644 --- a/gc.h +++ b/gc.h @@ -11,11 +11,11 @@ struct gc_ops; struct gc_chunk; typedef intptr_t gc_int; -typedef struct gc_chunk* gc_handle; +typedef uint32_t gc_handle; typedef struct gc_chunk { struct gc_ops * ops; - void *data[0]; + gc_handle data[0]; } gc_chunk; typedef void (*gc_relocate_op)(gc_chunk*);