# define GC_OPT_INIT /* empty */
#endif
+#define INIT_FIND_LEAK \
+ if (!GC_get_find_leak()) {} else \
+ GC_printf("This test program is not designed for leak detection mode\n")
+
#ifdef NO_CLOCK
# define INIT_PERF_MEASUREMENT (void)0
#else
#define GC_COND_INIT() \
INIT_FORK_SUPPORT; GC_OPT_INIT; CHECK_GCLIB_VERSION; \
- INIT_PRINT_STATS; INIT_PERF_MEASUREMENT
+ INIT_PRINT_STATS; INIT_FIND_LEAK; INIT_PERF_MEASUREMENT
#define CHECK_OUT_OF_MEMORY(p) \
if ((p) == NULL) { \
int wstatus;
# endif
- if (GC_get_find_leak())
- GC_printf(
- "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()) {
size_t max_heap_sz;
int i;
# ifndef GC_NO_FINALIZATION
- int still_live;
-# ifndef GC_LONG_REFS_NOT_NEEDED
- int still_long_live = 0;
-# endif
# ifdef FINALIZE_ON_DEMAND
int late_finalize_count = 0;
# endif
finalized_count, finalizable_count);
# ifndef GC_NO_FINALIZATION
if (!GC_get_find_leak()) {
+ int still_live = 0;
+# ifndef GC_LONG_REFS_NOT_NEEDED
+ int still_long_live = 0;
+# endif
+
# ifdef FINALIZE_ON_DEMAND
if (finalized_count != late_finalize_count) {
GC_printf("Demand finalization error\n");
} else {
GC_printf("finalization is probably ok\n");
}
- still_live = 0;
for (i = 0; i < MAX_FINALIZED; i++) {
if (live_indicators[i] != 0) {
still_live++;