FINALIZER_UNLOCK();
}
-# ifndef GC_NO_FINALIZATION
+# ifndef GC_NO_FINALIZATION
+ if (!GC_get_find_leak()) {
GC_REGISTER_FINALIZER((void *)result, finalizer, (void *)(GC_word)n,
(GC_finalization_proc *)0, (void * *)0);
if (my_index >= MAX_FINALIZED) {
FAIL;
}
# endif
-# endif
- GC_reachable_here(result);
+ }
+# endif
+ GC_reachable_here(result);
}
GC_END_STUBBORN_CHANGE(result);
return(result);
int wstatus;
# endif
-# ifdef FIND_LEAK
+ if (GC_get_find_leak())
GC_printf(
- "This test program is not designed for leak detection mode\n");
- GC_printf("Expect lots of problems\n");
-# endif
+ "This test program is not designed for leak detection mode\n"
+ "Expect lots of problems\n");
GC_FREE(0);
# ifdef THREADS
if (!GC_thread_is_registered()) {
GC_printf("Reallocated %d objects\n", (int)realloc_count);
GC_printf("Finalized %d/%d objects - ",
finalized_count, finalizable_count);
-# ifndef GC_NO_FINALIZATION
+# ifndef GC_NO_FINALIZATION
+ if (!GC_get_find_leak()) {
# ifdef FINALIZE_ON_DEMAND
if (finalized_count != late_finalize_count) {
GC_printf("Demand finalization error\n");
GC_printf("%d 'long' links remain\n", still_long_live);
}
# endif
-# endif
+ }
+# endif
GC_printf("Total number of bytes allocated is %lu\n",
(unsigned long)GC_get_total_bytes());
GC_printf("Total memory use by allocated blocks is %lu bytes\n",
GC_printf("Incorrect execution - missed some allocations\n");
FAIL;
}
- if (GC_get_heap_size() + GC_get_unmapped_bytes() > max_heap_sz) {
+ if (GC_get_heap_size() + GC_get_unmapped_bytes() > max_heap_sz
+ && !GC_get_find_leak()) {
GC_printf("Unexpected heap growth - collector may be broken"
" (heapsize: %lu, expected: %lu)\n",
(unsigned long)(GC_get_heap_size() + GC_get_unmapped_bytes()),
UNTESTED(GC_get_dont_precollect);
UNTESTED(GC_get_finalize_on_demand);
UNTESTED(GC_get_finalizer_notifier);
- UNTESTED(GC_get_find_leak);
UNTESTED(GC_get_force_unmap_on_gcollect);
UNTESTED(GC_get_free_bytes);
UNTESTED(GC_get_free_space_divisor);