* reclaim.c (GC_bytes_found): Expand comment.
* thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
granules, not bytes, to GC_FAST_MALLOC_GRANS.
* include/gc.h: Never include gc_local_alloc.h.
* tests/test.c: Add size zero allocation tests.
+2007-10-24 Hans Boehm <Hans.Boehm@hp.com>
+
+ * reclaim.c (GC_bytes_found): Expand comment.
+ * thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
+ granules, not bytes, to GC_FAST_MALLOC_GRANS.
+ * include/gc.h: Never include gc_local_alloc.h.
+ * tests/test.c: Add size zero allocation tests.
+
2007-10-23 Hans Boehm <Hans.Boehm@hp.com>
* malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
# include "gc_amiga_redirects.h"
#endif
-#if defined(GC_REDIRECT_TO_LOCAL) && !defined(GC_LOCAL_ALLOC_H)
-# include "gc_local_alloc.h"
+#if defined(GC_REDIRECT_TO_LOCAL)
+ /* Now redundant; that's the default with THREAD_LOCAL_ALLOC */
#endif
#ifdef __cplusplus
signed_word GC_bytes_found = 0;
/* Number of bytes of memory reclaimed */
+ /* minus the number of bytes originally */
+ /* on free lists which we had to drop. */
#if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
word GC_fl_builder_count = 0;
# endif
# endif /* DBG_HDRS_ALL */
/* Test floating point alignment */
- collectable_count += 2;
+ collectable_count += 2;
*(double *)GC_MALLOC(sizeof(double)) = 1.0;
*(double *)GC_MALLOC(sizeof(double)) = 1.0;
+ /* Test size 0 allocation a bit more */
+ {
+ size_t i;
+ for (i = 0; i < 10000; ++i) {
+ GC_MALLOC(0);
+ GC_FREE(GC_MALLOC(0));
+ GC_MALLOC_ATOMIC(0);
+ GC_FREE(GC_MALLOC_ATOMIC(0));
+ }
+ }
# ifdef GC_GCJ_SUPPORT
GC_REGISTER_DISPLACEMENT(sizeof(struct fake_vtable *));
GC_init_gcj_malloc(0, (void *)fake_gcj_mark_proc);
# endif
GC_ASSERT(GC_is_initialized);
tiny_fl = ((GC_tlfs)tsd) -> ptrfree_freelists;
- GC_FAST_MALLOC_GRANS(result, bytes, tiny_fl, DIRECT_GRANULES,
+ GC_FAST_MALLOC_GRANS(result, granules, tiny_fl, DIRECT_GRANULES,
PTRFREE, GC_core_malloc_atomic(bytes), 0/* no init */);
return result;
}
void **tiny_fl = ((GC_tlfs)GC_getspecific(GC_thread_key))
-> gcj_freelists;
GC_ASSERT(GC_gcj_malloc_initialized);
- GC_FAST_MALLOC_GRANS(result, bytes, tiny_fl, DIRECT_GRANULES,
+ GC_FAST_MALLOC_GRANS(result, granules, tiny_fl, DIRECT_GRANULES,
GC_gcj_kind,
GC_core_gcj_malloc(bytes,
ptr_to_struct_containing_descr),