}
if(ret==NULL){
GC_printf("Out of memory, (typed allocations are not directly "
- "supported with the GC_AMIGA_FASTALLOC option.)\n");
+ "supported with the GC_AMIGA_FASTALLOC option.)\n");
FAIL;
}
}
}
if(ret==NULL){
GC_printf("Out of memory, (typed allocations are not directly "
- "supported with the GC_AMIGA_FASTALLOC option.)\n");
+ "supported with the GC_AMIGA_FASTALLOC option.)\n");
FAIL;
}
}
stubborn_count++;
r = (sexpr) GC_MALLOC_STUBBORN(sizeof(struct SEXPR) + my_extra);
if (r == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
for (p = (int *)r;
((char *)p) < ((char *)r) + my_extra + sizeof(struct SEXPR); p++) {
if (*p) {
- (void)GC_printf("Found nonzero at %p - allocator is broken\n", p);
+ GC_printf("Found nonzero at %p - allocator is broken\n", p);
FAIL;
}
*p = (int)((13 << 12) + ((p - (int *)r) & 0xfff));
collectable_count++;
r = (sexpr) GC_MALLOC(sizeof(struct SEXPR));
if (r == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
r -> sexpr_car = x;
uncollectable_count++;
r = (sexpr) GC_MALLOC_UNCOLLECTABLE(sizeof(struct SEXPR));
if (r == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
r -> sexpr_car = x;
+ sizeof(struct fake_vtable*),
&gcj_class_struct2);
if (r == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
result = (sexpr)(r + 1);
void check_ints(sexpr list, int low, int up)
{
if (SEXPR_TO_INT(car(car(list))) != low) {
- (void)GC_printf(
+ GC_printf(
"List reversal produced incorrect list - collector is broken\n");
FAIL;
}
if (low == up) {
if (cdr(list) != nil) {
- (void)GC_printf("List too long - collector is broken\n");
+ GC_printf("List too long - collector is broken\n");
FAIL;
}
} else {
void check_uncollectable_ints(sexpr list, int low, int up)
{
if (SEXPR_TO_INT(car(car(list))) != low) {
- (void)GC_printf(
- "Uncollectable list corrupted - collector is broken\n");
+ GC_printf("Uncollectable list corrupted - collector is broken\n");
FAIL;
}
if (low == up) {
- if (UNCOLLECTABLE_CDR(list) != nil) {
- (void)GC_printf("Uncollectable list too long - collector is broken\n");
- FAIL;
- }
+ if (UNCOLLECTABLE_CDR(list) != nil) {
+ GC_printf("Uncollectable list too long - collector is broken\n");
+ FAIL;
+ }
} else {
check_uncollectable_ints(UNCOLLECTABLE_CDR(list), low+1, up);
}
void print_int_list(sexpr x)
{
if (is_nil(x)) {
- (void)GC_printf("NIL\n");
+ GC_printf("NIL\n");
} else {
- (void)GC_printf("(%d)", SEXPR_TO_INT(car(car(x))));
+ GC_printf("(%d)", SEXPR_TO_INT(car(car(x))));
if (!is_nil(cdr(x))) {
- (void)GC_printf(", ");
- (void)print_int_list(cdr(x));
+ GC_printf(", ");
+ print_int_list(cdr(x));
} else {
- (void)GC_printf("\n");
+ GC_printf("\n");
}
}
}
else
GC_printf("[mkd:%p]", x);
if (is_nil(x)) {
- (void)GC_printf("NIL\n");
+ GC_printf("NIL\n");
} else {
- if (!GC_is_marked((ptr_t)car(x))) GC_printf("[unm car:%p]", car(x));
- (void)GC_printf("(%d)", SEXPR_TO_INT(car(car(x))));
+ if (!GC_is_marked((ptr_t)car(x)))
+ GC_printf("[unm car:%p]", car(x));
+ GC_printf("(%d)", SEXPR_TO_INT(car(car(x))));
if (!is_nil(cdr(x))) {
- (void)GC_printf(", ");
- (void)check_marks_int_list(cdr(x));
+ GC_printf(", ");
+ check_marks_int_list(cdr(x));
} else {
- (void)GC_printf("\n");
+ GC_printf("\n");
}
}
}
pthread_t t;
int code;
if ((code = pthread_create(&t, 0, tiny_reverse_test, 0)) != 0) {
- (void)GC_printf("Small thread creation failed %d\n", code);
+ GC_printf("Small thread creation failed %d\n", code);
FAIL;
}
if ((code = pthread_join(t, 0)) != 0) {
- (void)GC_printf("Small thread join failed %d\n", code);
+ GC_printf("Small thread join failed %d\n", code);
FAIL;
}
}
HANDLE h;
h = GC_CreateThread(NULL, 0, tiny_reverse_test, 0, 0, &thread_id);
if (h == (HANDLE)NULL) {
- (void)GC_printf("Small thread creation failed %d\n",
- (int)GetLastError());
+ GC_printf("Small thread creation failed %d\n",
+ (int)GetLastError());
FAIL;
}
if (WaitForSingleObject(h, INFINITE) != WAIT_OBJECT_0) {
- (void)GC_printf("Small thread wait failed %d\n",
- (int)GetLastError());
+ GC_printf("Small thread wait failed %d\n",
+ (int)GetLastError());
FAIL;
}
}
EnterCriticalSection(&incr_cs);
# endif
if ((int)(GC_word)client_data != t -> level) {
- (void)GC_printf("Wrong finalization data - collector is broken\n");
+ GC_printf("Wrong finalization data - collector is broken\n");
FAIL;
}
finalized_count++;
live_indicators =
(GC_word*)NewPtrClear(MAX_FINALIZED * sizeof(GC_word));
if (!live_indicators) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
# endif
if (n == 0) return(0);
if (result == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
exit(1);
}
result -> level = n;
void chktree(tn *t, int n)
{
if (n == 0 && t != 0) {
- (void)GC_printf("Clobbered a leaf - collector is broken\n");
+ GC_printf("Clobbered a leaf - collector is broken\n");
FAIL;
}
if (n == 0) return;
if (t -> level != n) {
- (void)GC_printf("Lost a node at level %d - collector is broken\n", n);
+ GC_printf("Lost a node at level %d - collector is broken\n", n);
FAIL;
}
if (counter++ % 373 == 0) {
uncollectable_count++;
my_free_list_ptr = GC_NEW_UNCOLLECTABLE(void *);
if (pthread_setspecific(fl_key, my_free_list_ptr) != 0) {
- (void)GC_printf("pthread_setspecific failed\n");
+ GC_printf("pthread_setspecific failed\n");
FAIL;
}
}
if (my_free_list == 0) {
my_free_list = GC_malloc_many(8);
if (my_free_list == 0) {
- (void)GC_printf("alloc8bytes out of memory\n");
+ GC_printf("alloc8bytes out of memory\n");
FAIL;
}
}
for (i = 0; i < n; i += 8) {
atomic_count++;
if (alloc8bytes() == 0) {
- (void)GC_printf("Out of memory\n");
+ GC_printf("Out of memory\n");
FAIL;
}
}
# endif
chktree(root, TREE_HEIGHT);
if (finalized_count && ! dropped_something) {
- (void)GC_printf("Premature finalization - collector is broken\n");
+ GC_printf("Premature finalization - collector is broken\n");
FAIL;
}
dropped_something = 1;
}
for (i = 0; i < 20000; i++) {
if (new[0] != 17) {
- (void)GC_printf("typed alloc failed at %lu\n",
- (unsigned long)i);
+ GC_printf("typed alloc failed at %lu\n", (unsigned long)i);
FAIL;
}
new[0] = 0;
# ifdef FIND_LEAK
GC_printf(
- "This test program is not designed for leak detection mode\n");
- GC_printf("Expect lots of problems.\n");
+ "This test program is not designed for leak detection mode\n");
+ GC_printf("Expect lots of problems\n");
# endif
GC_FREE(0);
# ifndef DBG_HDRS_ALL
collectable_count += 3;
if ((GC_size(GC_malloc(7)) != 8 &&
GC_size(GC_malloc(7)) != MIN_WORDS * sizeof(GC_word))
- || GC_size(GC_malloc(15)) != 16) {
- GC_printf("GC_size produced unexpected results\n");
- FAIL;
+ || GC_size(GC_malloc(15)) != 16) {
+ GC_printf("GC_size produced unexpected results\n");
+ FAIL;
}
collectable_count += 1;
if (GC_size(GC_malloc(0)) != MIN_WORDS * sizeof(GC_word)) {
GC_printf("GC_malloc(0) failed: GC_size returns %ld\n",
- (unsigned long)GC_size(GC_malloc(0)));
+ (unsigned long)GC_size(GC_malloc(0)));
FAIL;
}
collectable_count += 1;
if (GC_is_valid_displacement(y) != y
|| GC_is_valid_displacement(x) != x
|| GC_is_valid_displacement(x + 3) != x + 3) {
- GC_printf(
- "GC_is_valid_displacement produced incorrect result\n");
+ GC_printf("GC_is_valid_displacement produced incorrect result\n");
FAIL;
}
{
if (!TEST_FAIL_COUNT(GC_get_all_interior_pointers() ? 1 : 2))
# endif
{
- GC_printf("GC_is_valid_displacement produced wrong failure indication\n");
+ GC_printf(
+ "GC_is_valid_displacement produced wrong failure indication\n");
FAIL;
}
# endif
GET_TIME(tree_time);
time_diff = MS_TIME_DIFF(tree_time, start_time);
GC_log_printf("-------------Finished tree_test at time %u (%p)\n",
- (unsigned) time_diff, &start_time);
+ (unsigned) time_diff, &start_time);
}
/* Run reverse_test a second time, so we hopefully notice corruption. */
reverse_test();
GC_log_printf("Primordial thread stack bottom: %p\n",
GC_stackbottom);
}
- (void)GC_printf("Completed %u tests\n", n_tests);
- (void)GC_printf("Allocated %d collectable objects\n", collectable_count);
- (void)GC_printf("Allocated %d uncollectable objects\n",
- uncollectable_count);
- (void)GC_printf("Allocated %d atomic objects\n", atomic_count);
- (void)GC_printf("Allocated %d stubborn objects\n", stubborn_count);
- (void)GC_printf("Finalized %d/%d objects - ",
- finalized_count, finalizable_count);
+ GC_printf("Completed %u tests\n", n_tests);
+ GC_printf("Allocated %d collectable objects\n", collectable_count);
+ GC_printf("Allocated %d uncollectable objects\n",
+ uncollectable_count);
+ GC_printf("Allocated %d atomic objects\n", atomic_count);
+ GC_printf("Allocated %d stubborn objects\n", stubborn_count);
+ GC_printf("Finalized %d/%d objects - ",
+ finalized_count, finalizable_count);
# ifdef FINALIZE_ON_DEMAND
if (finalized_count != late_finalize_count) {
- (void)GC_printf("Demand finalization error\n");
+ GC_printf("Demand finalization error\n");
FAIL;
}
# endif
if (finalized_count > finalizable_count
|| finalized_count < finalizable_count/2) {
- (void)GC_printf("finalization is probably broken\n");
+ GC_printf("finalization is probably broken\n");
FAIL;
} else {
- (void)GC_printf("finalization is probably ok\n");
+ GC_printf("finalization is probably ok\n");
}
still_live = 0;
for (i = 0; i < MAX_FINALIZED; i++) {
i = finalizable_count - finalized_count - still_live;
if (0 != i) {
GC_printf("%d disappearing links remain and %d more objects "
- "were not finalized\n", still_live, i);
+ "were not finalized\n", still_live, i);
if (i > 10) {
GC_printf("\tVery suspicious!\n");
} else {
- GC_printf("\tSlightly suspicious, but probably OK.\n");
+ GC_printf("\tSlightly suspicious, but probably OK\n");
}
}
- (void)GC_printf("Total number of bytes allocated is %lu\n",
- (unsigned long)GC_get_total_bytes());
- (void)GC_printf("Final heap size is %lu bytes\n",
- (unsigned long)GC_get_heap_size());
+ GC_printf("Total number of bytes allocated is %lu\n",
+ (unsigned long)GC_get_total_bytes());
+ GC_printf("Final heap size is %lu bytes\n",
+ (unsigned long)GC_get_heap_size());
if (GC_get_total_bytes() < n_tests *
# ifdef VERY_SMALL_CONFIG
2700000
33500000
# endif
) {
- (void)GC_printf("Incorrect execution - missed some allocations\n");
- FAIL;
+ GC_printf("Incorrect execution - missed some allocations\n");
+ FAIL;
}
if (GC_get_heap_size() + GC_get_unmapped_bytes() > max_heap_sz*n_tests) {
- (void)GC_printf("Unexpected heap growth - collector may be broken\n");
+ GC_printf("Unexpected heap growth - collector may be broken\n");
FAIL;
}
# ifdef THREADS
GC_unregister_my_thread(); /* just to check it works (for main) */
# endif
- (void)GC_printf("Collector appears to work\n");
+ GC_printf("Collector appears to work\n");
}
#if defined(MACOS)
/* Make sure we have lots and lots of stack space. */
SetMinimumStack(cMinStackSpace);
/* Cheat and let stdio initialize toolbox for us. */
- printf("Testing GC Macintosh port.\n");
+ printf("Testing GC Macintosh port\n");
# endif
GC_COND_INIT();
GC_set_warn_proc(warn_proc);
# ifdef MSWINCE
win_created_h = CreateEvent(NULL, FALSE, FALSE, NULL);
if (win_created_h == (HANDLE)NULL) {
- (void)GC_printf("Event creation failed %d\n", (int)GetLastError());
+ GC_printf("Event creation failed %d\n", (int)GetLastError());
FAIL;
}
win_thr_h = GC_CreateThread(NULL, 0, thr_window, 0, 0, &thread_id);
if (win_thr_h == (HANDLE)NULL) {
- (void)GC_printf("Thread creation failed %d\n", (int)GetLastError());
+ GC_printf("Thread creation failed %d\n", (int)GetLastError());
FAIL;
}
if (WaitForSingleObject(win_created_h, INFINITE) != WAIT_OBJECT_0)
for (i = 0; i < NTHREADS; i++) {
h[i] = GC_CreateThread(NULL, 0, thr_run_one_test, 0, 0, &thread_id);
if (h[i] == (HANDLE)NULL) {
- (void)GC_printf("Thread creation failed %d\n", (int)GetLastError());
+ GC_printf("Thread creation failed %d\n", (int)GetLastError());
FAIL;
}
}
# if NTHREADS > 0
for (i = 0; i < NTHREADS; i++) {
if (WaitForSingleObject(h[i], INFINITE) != WAIT_OBJECT_0) {
- (void)GC_printf("Thread wait failed %d\n", (int)GetLastError());
+ GC_printf("Thread wait failed %d\n", (int)GetLastError());
FAIL;
}
}
run_one_test();
if (PCR_Th_T_Join(th1, &code, NIL, PCR_allSigsBlocked, PCR_waitForever)
!= PCR_ERes_okay || code != 0) {
- (void)GC_printf("Thread 1 failed\n");
+ GC_printf("Thread 1 failed\n");
}
if (PCR_Th_T_Join(th2, &code, NIL, PCR_allSigsBlocked, PCR_waitForever)
!= PCR_ERes_okay || code != 0) {
- (void)GC_printf("Thread 2 failed\n");
+ GC_printf("Thread 2 failed\n");
}
check_heap_stats();
return(0);
/* Default stack size is too small, especially with the 64 bit ABI */
/* Increase it. */
if (pthread_default_stacksize_np(1024*1024, 0) != 0) {
- (void)GC_printf("pthread_default_stacksize_np failed.\n");
+ GC_printf("pthread_default_stacksize_np failed\n");
}
# endif /* GC_HPUX_THREADS */
# ifdef PTW32_STATIC_LIB
&& !defined(MAKE_BACK_GRAPH) && !defined(USE_PROC_FOR_LIBRARIES) \
&& !defined(NO_INCREMENTAL)
GC_enable_incremental();
- (void) GC_printf("Switched to incremental mode\n");
+ GC_printf("Switched to incremental mode\n");
# if defined(MPROTECT_VDB)
- (void)GC_printf("Emulating dirty bits with mprotect/signals\n");
+ GC_printf("Emulating dirty bits with mprotect/signals\n");
# else
# ifdef PROC_VDB
- (void)GC_printf("Reading dirty bits from /proc\n");
+ GC_printf("Reading dirty bits from /proc\n");
# else
- (void)GC_printf("Using DEFAULT_VDB dirty bit implementation\n");
+ GC_printf("Using DEFAULT_VDB dirty bit implementation\n");
# endif
# endif
# endif
GC_set_warn_proc(warn_proc);
if ((code = pthread_key_create(&fl_key, 0)) != 0) {
- (void)GC_printf("Key creation failed %d\n", code);
+ GC_printf("Key creation failed %d\n", code);
FAIL;
}
for (i = 0; i < NTHREADS; ++i) {
if ((code = pthread_create(th+i, &attr, thr_run_one_test, 0)) != 0) {
- (void)GC_printf("Thread %d creation failed %d\n", i, code);
+ GC_printf("Thread %d creation failed %d\n", i, code);
FAIL;
}
}
run_one_test();
for (i = 0; i < NTHREADS; ++i) {
if ((code = pthread_join(th[i], 0)) != 0) {
- (void)GC_printf("Thread %d failed %d\n", i, code);
+ GC_printf("Thread %d failed %d\n", i, code);
FAIL;
}
}