From: ivmai Date: Mon, 11 Apr 2011 19:51:54 +0000 (+0000) Subject: 2011-04-11 Ivan Maidanski (mostly really Jim Meyering) X-Git-Tag: gc7_2alpha6~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5867334b7e53d5d5695bbe567665af9330cf7c5d;p=gc 2011-04-11 Ivan Maidanski (mostly really Jim Meyering) * configure.host: Remove doubled words in comments. * os_dep.c: Ditto. * doc/README: Ditto. * extra/setjmp_t.c: Ditto. * tests/huge_test.c: Ditto. * extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the K&R-style function definition with the ANSI C one. * extra/setjmp_t.c: Expand all tabs to spaces. * extra/setjmp_t.c (nested_sp): Implement in the same way as GC_approx_sp. --- diff --git a/ChangeLog b/ChangeLog index f2d1ded9..8d700e09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-04-11 Ivan Maidanski (mostly really Jim Meyering) + + * configure.host: Remove doubled words in comments. + * os_dep.c: Ditto. + * doc/README: Ditto. + * extra/setjmp_t.c: Ditto. + * tests/huge_test.c: Ditto. + * extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the + K&R-style function definition with the ANSI C one. + * extra/setjmp_t.c: Expand all tabs to spaces. + * extra/setjmp_t.c (nested_sp): Implement in the same way as + GC_approx_sp. + 2011-04-10 Ivan Maidanski (really Iain Sandoe, Mike Stump) * dyn_load.c (GC_dyld_sections): Add more sctions. diff --git a/configure.host b/configure.host index a98a0a7c..898c9236 100644 --- a/configure.host +++ b/configure.host @@ -2,7 +2,7 @@ # This shell script handles all host based configuration for the garbage # collector. -# It sets various shell variables based on the the host and the +# It sets various shell variables based on the host and the # configuration options. You can modify this shell script without # needing to rerun autoconf. @@ -26,7 +26,7 @@ gc_cflags="" if test :"$GCC": = :yes: ; then gc_cflags="${gc_cflags} -fexceptions" else - case "$host" in + case "$host" in hppa*-*-hpux* ) if test :$GCC: != :"yes": ; then gc_cflags="${gc_flags} +ESdbgasm" diff --git a/doc/README b/doc/README index 5ca93f09..e9252bc5 100644 --- a/doc/README +++ b/doc/README @@ -129,7 +129,7 @@ ALL_INTERIOR_POINTERS defined, or GC_all_interior_pointers is otherwise set, as is now the default. Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention -of garbage objects, by requiring pointers from the heap to to the beginning +of garbage objects, by requiring pointers from the heap to the beginning of an object. But this no longer appears to be a significant issue for most programs occupying a small fraction of the possible address space. diff --git a/extra/setjmp_t.c b/extra/setjmp_t.c index 5a171df0..5f4519b2 100644 --- a/extra/setjmp_t.c +++ b/extra/setjmp_t.c @@ -10,126 +10,127 @@ * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ - + /* Check whether setjmp actually saves registers in jmp_buf. */ /* If it doesn't, the generic mark_regs code won't work. */ -/* Compilers vary as to whether they will put x in a */ -/* (callee-save) register without -O. The code is */ +/* Compilers vary as to whether they will put x in a */ +/* (callee-save) register without -O. The code is */ /* contrived such that any decent compiler should put x in */ -/* a callee-save register with -O. Thus it is is */ +/* a callee-save register with -O. Thus it is */ /* recommended that this be run optimized. (If the machine */ /* has no callee-save registers, then the generic code is */ /* safe, but this will not be noticed by this piece of */ -/* code.) This test appears to be far from perfect. */ +/* code.) This test appears to be far from perfect. */ #include #include #include #include "private/gc_priv.h" #ifdef OS2 -/* GETPAGESIZE() is set to getpagesize() by default, but that */ -/* doesn't really exist, and the collector doesn't need it. */ +/* GETPAGESIZE() is set to getpagesize() by default, but that */ +/* doesn't really exist, and the collector doesn't need it. */ #define INCL_DOSFILEMGR #define INCL_DOSMISC #define INCL_DOSERRORS #include -int -getpagesize() +int getpagesize(void) { ULONG result[1]; - + if (DosQuerySysInfo(QSV_PAGE_SIZE, QSV_PAGE_SIZE, - (void *)result, sizeof(ULONG)) != NO_ERROR) { - fprintf(stderr, "DosQuerySysInfo failed\n"); - result[0] = 4096; + (void *)result, sizeof(ULONG)) != NO_ERROR) { + fprintf(stderr, "DosQuerySysInfo failed\n"); + result[0] = 4096; } return((int)(result[0])); } #endif -struct {char a_a; char * a_b;} a; +struct { + char a_a; + char * a_b; +} a; -int * nested_sp() +int * nested_sp(void) { - int dummy; - - return(&dummy); + volatile int sp; + sp = (int)&sp; + return (int *)sp; } -int main() +int main(void) { - int dummy; - long ps = GETPAGESIZE(); - jmp_buf b; - register int x = (int)strlen("a"); /* 1, slightly disguised */ - static int y = 0; + int dummy; + long ps = GETPAGESIZE(); + jmp_buf b; + register int x = (int)strlen("a"); /* 1, slightly disguised */ + static int y = 0; - printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE); - if (nested_sp() < &dummy) { - printf("Stack appears to grow down, which is the default.\n"); - printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n", - ((unsigned long)(&dummy) + ps) & ~(ps-1)); - } else { - printf("Stack appears to grow up.\n"); - printf("Define STACK_GROWS_UP in gc_private.h\n"); - printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n", - ((unsigned long)(&dummy) + ps) & ~(ps-1)); - } - printf("Note that this may vary between machines of ostensibly\n"); - printf("the same architecture (e.g. Sun 3/50s and 3/80s).\n"); - printf("On many machines the value is not fixed.\n"); - printf("A good guess for ALIGNMENT on this machine is %ld.\n", - (unsigned long)(&(a.a_b))-(unsigned long)(&a)); - - printf("The following is a very dubious test of one root marking" - " strategy.\n"); - printf("Results may not be accurate/useful:\n"); - /* Encourage the compiler to keep x in a callee-save register */ - x = 2*x-1; - printf(""); - x = 2*x-1; - setjmp(b); - if (y == 1) { - if (x == 2) { - printf("Setjmp-based generic mark_regs code probably wont work.\n"); - printf("But we rarely try that anymore. If you have getcontect()\n"); - printf("this probably doesn't matter.\n"); - } else if (x == 1) { - printf("Setjmp-based register marking code may work.\n"); - } else { - printf("Very strange setjmp implementation.\n"); - } - } - y++; - x = 2; - if (y == 1) longjmp(b,1); - printf("Some GC internal configuration stuff: \n"); - printf("\tWORDSZ = %d, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n", - WORDSZ, ALIGNMENT, GC_GRANULE_BYTES); - printf("\tUsing one mark "); -# if defined(USE_MARK_BYTES) - printf("byte"); -# elif defined(USE_MARK_BITS) - printf("bit"); -# endif - printf(" per "); -# if defined(MARK_BIT_PER_OBJ) - printf("object.\n"); -# elif defined(MARK_BIT_PER_GRANULE) - printf("granule.\n"); -# endif -# ifdef THREAD_LOCAL_ALLOC - printf("Thread local allocation enabled.\n"); -# endif -# ifdef PARALLEL_MARK - printf("Parallel marking enabled.\n"); -# endif - return(0); + printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE); + if (nested_sp() < &dummy) { + printf("Stack appears to grow down, which is the default.\n"); + printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n", + ((unsigned long)(&dummy) + ps) & ~(ps-1)); + } else { + printf("Stack appears to grow up.\n"); + printf("Define STACK_GROWS_UP in gc_private.h\n"); + printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n", + ((unsigned long)(&dummy) + ps) & ~(ps-1)); + } + printf("Note that this may vary between machines of ostensibly\n"); + printf("the same architecture (e.g. Sun 3/50s and 3/80s).\n"); + printf("On many machines the value is not fixed.\n"); + printf("A good guess for ALIGNMENT on this machine is %ld.\n", + (unsigned long)(&(a.a_b))-(unsigned long)(&a)); + + printf("The following is a very dubious test of one root marking" + " strategy.\n"); + printf("Results may not be accurate/useful:\n"); + /* Encourage the compiler to keep x in a callee-save register */ + x = 2*x-1; + printf(""); + x = 2*x-1; + setjmp(b); + if (y == 1) { + if (x == 2) { + printf("Setjmp-based generic mark_regs code probably wont work.\n"); + printf("But we rarely try that anymore. If you have getcontect()\n"); + printf("this probably doesn't matter.\n"); + } else if (x == 1) { + printf("Setjmp-based register marking code may work.\n"); + } else { + printf("Very strange setjmp implementation.\n"); + } + } + y++; + x = 2; + if (y == 1) longjmp(b,1); + printf("Some GC internal configuration stuff: \n"); + printf("\tWORDSZ = %d, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n", + WORDSZ, ALIGNMENT, GC_GRANULE_BYTES); + printf("\tUsing one mark "); +# if defined(USE_MARK_BYTES) + printf("byte"); +# elif defined(USE_MARK_BITS) + printf("bit"); +# endif + printf(" per "); +# if defined(MARK_BIT_PER_OBJ) + printf("object.\n"); +# elif defined(MARK_BIT_PER_GRANULE) + printf("granule.\n"); +# endif +# ifdef THREAD_LOCAL_ALLOC + printf("Thread local allocation enabled.\n"); +# endif +# ifdef PARALLEL_MARK + printf("Parallel marking enabled.\n"); +# endif + return(0); } -int g(x) -int x; +int g(int x) { - return(x); + return(x); } diff --git a/os_dep.c b/os_dep.c index eed14b8f..61ce2e2e 100644 --- a/os_dep.c +++ b/os_dep.c @@ -2707,7 +2707,7 @@ STATIC void GC_default_push_other_roots(void) * the underlying memory was not allocated with the appropriate * flag. This is common if GC_enable_incremental is called * shortly after GC initialization. To avoid modifying the - * interface, we silently work around such a failure, it it only + * interface, we silently work around such a failure, it only * affects the initial (small) heap allocation. * If there are more dirty * pages than will fit in the buffer, this is not treated as a @@ -4467,7 +4467,7 @@ GC_API int GC_CALL GC_get_pages_executable(void) # include # endif # if NARGS > 6 -# error We only know how to to get the first 6 arguments +# error We only know how to get the first 6 arguments # endif #endif /* SPARC */ diff --git a/tests/huge_test.c b/tests/huge_test.c index 5ecc8311..bde9836d 100644 --- a/tests/huge_test.c +++ b/tests/huge_test.c @@ -14,7 +14,7 @@ /* * Check that very large allocation requests fail. "Success" would usually - * indicate that the the size was somehow converted to a negative + * indicate that the size was somehow converted to a negative * number. Clients shouldn't do this, but we should fail in the * expected manner. */