From 050fe79a752814cf63ae9f40620febbb86cae1ce Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Apr 2012 09:41:49 -0700 Subject: Code cleanup and tweaking. * gc.c (BACKPTR_VEC_SIZE): Preprocessor symbol renamed to CHECKOBJ_VEC_SIZE. (FULL_GC_INTERVAL): Increased to 40 since the modified algorithm now leaves less work for the full gc to do. (backptr, backptr_idx): Static variables renamed to checkobj and checkobj_idx. (mark): Follows rename of backptr and backptr_idx. (gc): Commented out handy printf added. (gc_set): Use in_malloc_range check to avoid adding to the check array pointers which are being stored in non-heap locations, since non-heap locations are already GC roots. (gc_mutated): Follows variable renaming. (gc_push): Just do the push using gc_set. * lib.c (malloc_low_bound, malloc_high_bound): New variables. (chk_malloc, chk_calloc, chk_realloc): Updated malloc_low_bound and malloc_high_bound. (in_malloc_range): New function. * lib.h (in_malloc_range): Declared. --- lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib.h') diff --git a/lib.h b/lib.h index 2b6baecc..1f8360c1 100644 --- a/lib.h +++ b/lib.h @@ -393,6 +393,7 @@ val equal(val left, val right); mem_t *chk_malloc(size_t size); mem_t *chk_calloc(size_t n, size_t size); mem_t *chk_realloc(mem_t *, size_t size); +int in_malloc_range(mem_t *); wchar_t *chk_strdup(const wchar_t *str); val cons(val car, val cdr); val make_lazy_cons(val func); -- cgit v1.2.3