=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/gc/tests/test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- OpenXM_contrib2/asir2000/gc/tests/test.c 2002/07/24 08:00:21 1.1 +++ OpenXM_contrib2/asir2000/gc/tests/test.c 2003/06/24 05:11:43 1.2 @@ -68,15 +68,15 @@ # include # endif -# ifdef GC_WIN32_THREADS -# ifndef MSWINCE -# include -# define GC_CreateThread(a,b,c,d,e,f) ((HANDLE) _beginthreadex(a,b,c,d,e,f)) -# endif +# if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) static CRITICAL_SECTION incr_cs; # endif +#ifdef __STDC__ +# include +#endif + /* Allocation Statistics */ int stubborn_count = 0; int uncollectable_count = 0; @@ -376,6 +376,9 @@ sexpr x, y; sexpr reverse(x) sexpr x; { +# ifdef TEST_WITH_SYSTEM_MALLOC + malloc(100000); +# endif return( reverse1(x, nil) ); } @@ -517,20 +520,13 @@ sexpr x; } } -/* Try to force a to be strangely aligned */ -struct { - char dummy; - sexpr aa; -} A; -#define a A.aa - /* * A tiny list reversal test to check thread creation. */ #ifdef THREADS # if defined(GC_WIN32_THREADS) && !defined(CYGWIN32) - unsigned __stdcall tiny_reverse_test(void * arg) + DWORD __stdcall tiny_reverse_test(void * arg) # else void * tiny_reverse_test(void * arg) # endif @@ -565,7 +561,7 @@ struct { # elif defined(GC_WIN32_THREADS) void fork_a_thread() { - unsigned thread_id; + DWORD thread_id; HANDLE h; h = GC_CreateThread(NULL, 0, tiny_reverse_test, 0, 0, &thread_id); if (h == (HANDLE)NULL) { @@ -594,6 +590,13 @@ struct { #endif +/* Try to force a to be strangely aligned */ +struct { + char dummy; + sexpr aa; +} A; +#define a A.aa + /* * Repeatedly reverse lists built out of very different sized cons cells. * Check that we didn't lose anything. @@ -714,6 +717,8 @@ void reverse_test() b = c = 0; } +#undef a + /* * The rest of this builds balanced binary trees, checks that they don't * disappear, and tests finalization. @@ -758,6 +763,7 @@ VOLATILE int dropped_something = 0; FAIL; } finalized_count++; + t -> level = -1; /* detect duplicate finalization immediately */ # ifdef PCR PCR_ThCrSec_ExitSys(); # endif @@ -1165,6 +1171,25 @@ void fail_proc1(GC_PTR x) fail_count++; } +static void uniq(void *p, ...) { + va_list a; + void *q[100]; + int n = 0, i, j; + q[n++] = p; + va_start(a,p); + for (;(q[n] = va_arg(a,void *));n++) ; + va_end(a); + for (i=0; i