Permalink
Browse files

Turn off DONT_ADD_BYTE_AT_END.

DONT_ADD_BYTE_AT_END was introduced with AnnotatedPair optimization.
But it had discoverd some heap corruption bug..
  • Loading branch information...
1 parent 9a8b0c5 commit 6e0245e2b4d35b1d1a5f0b30a1f8114b1d96693f @okuoku committed May 24, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −1 extlibs/gc-7.1/configure.ac
  2. +8 −0 src/Pair.h
@@ -49,7 +49,7 @@ AC_DEFINE(LARGE_CONFIG)
AC_DEFINE(NO_CLOCK)
## DONT_ADD_BYTE_AT_END is required to distinguish annotated pair and normal pair. See isAnnotatedPair.
-AC_DEFINE(DONT_ADD_BYTE_AT_END)
+#AC_DEFINE(DONT_ADD_BYTE_AT_END)
## Mosh end
GC_CFLAGS=${gc_cflags}
View
@@ -205,6 +205,14 @@ struct AnnotatedPair
Object car;
Object cdr;
+#ifdef GC_DEBUG
+#error current AnnotatedPair implementation is not compatible with GC_DEBUG
+#endif
+ // FIXME: do some magic!
+ // We will use GC_size to distinguish Pair and AnnotatedPair.
+ // But GC_size is not fully reliable. So we inject 2 more
+ // words here.
+ void* bogus[2];
Object annotation;
};

0 comments on commit 6e0245e

Please sign in to comment.