From c9aaf2f0d55451a0a3d25c1212f4c9c4119e1aa4 Mon Sep 17 00:00:00 2001 From: ivmai Date: Fri, 6 Nov 2009 09:17:00 +0000 Subject: [PATCH] 2009-11-06 Ivan Maidanski * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef. * misc.c (WIN32_LEAN_AND_MEAN): Ditto. * os_dep.c (WIN32_LEAN_AND_MEAN): Ditto. * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't) in a comment. * backgraph.c: Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * extra/threadlibs.c (main): Ditto. * pthread_support.c (pthread_join): Ditto. * tests/test.c (main): Ditto. --- ChangeLog | 13 +++++++++++++ allchblk.c | 2 +- backgraph.c | 22 +++++++++++----------- dyn_load.c | 6 ++++-- extra/threadlibs.c | 4 ++-- misc.c | 4 +++- os_dep.c | 4 +++- pthread_support.c | 2 +- tests/test.c | 4 ++-- 9 files changed, 40 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a1b0a21..0a98e5be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-11-06 Ivan Maidanski + + * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef. + * misc.c (WIN32_LEAN_AND_MEAN): Ditto. + * os_dep.c (WIN32_LEAN_AND_MEAN): Ditto. + * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't) + in a comment. + * backgraph.c: Ditto. + * dyn_load.c (GC_register_dynamic_libraries): Ditto. + * extra/threadlibs.c (main): Ditto. + * pthread_support.c (pthread_join): Ditto. + * tests/test.c (main): Ditto. + 2009-11-06 Ivan Maidanski * mach_dep.c (GC_push_regs): Remove STATIC (just to catch diff --git a/allchblk.c b/allchblk.c index 2c243acd..d6a14371 100644 --- a/allchblk.c +++ b/allchblk.c @@ -752,7 +752,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, (void) setup_header( hhdr, h, HBLKSIZE, - PTRFREE, 0); /* Cant fail */ + PTRFREE, 0); /* Can't fail */ if (GC_debugging_started) { BZERO(h, HBLKSIZE); } diff --git a/backgraph.c b/backgraph.c index c2e2e29c..84806ba3 100644 --- a/backgraph.c +++ b/backgraph.c @@ -33,16 +33,16 @@ /* #include */ #if !defined(DBG_HDRS_ALL) || (ALIGNMENT != CPP_WORDSZ/8) /* || !defined(UNIX_LIKE) */ -# error Configuration doesnt support MAKE_BACK_GRAPH +# error Configuration doesn't support MAKE_BACK_GRAPH #endif -/* We store single back pointers directly in the object's oh_bg_ptr field. */ -/* If there is more than one ptr to an object, we store q | FLAG_MANY, */ -/* where q is a pointer to a back_edges object. */ -/* Every once in a while we use a back_edges object even for a single */ -/* pointer, since we need the other fields in the back_edges structure to */ -/* be present in some fraction of the objects. Otherwise we get serious */ -/* performance issues. */ +/* We store single back pointers directly in the object's oh_bg_ptr field. */ +/* If there is more than one ptr to an object, we store q | FLAG_MANY, */ +/* where q is a pointer to a back_edges object. */ +/* Every once in a while we use a back_edges object even for a single */ +/* pointer, since we need the other fields in the back_edges structure to */ +/* be present in some fraction of the objects. Otherwise we get serious */ +/* performance issues. */ #define FLAG_MANY 2 typedef struct back_edges_struct { @@ -360,9 +360,9 @@ static word backwards_height(ptr_t p) if (0 == back_ptr) return 1; if (!((word)back_ptr & FLAG_MANY)) { - if (is_in_progress(p)) return 0; /* DFS back edge, i.e. we followed */ - /* an edge to an object already */ - /* on our stack: ignore */ + if (is_in_progress(p)) return 0; /* DFS back edge, i.e. we followed */ + /* an edge to an object already */ + /* on our stack: ignore */ push_in_progress(p); result = backwards_height(back_ptr)+1; pop_in_progress(p); diff --git a/dyn_load.c b/dyn_load.c index ccb08d53..ee50807b 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -772,7 +772,7 @@ GC_INNER void GC_register_dynamic_libraries(void) } /* Don't keep cached descriptor, for now. Some kernels don't like us */ /* to keep a /proc file descriptor around during kill -9. */ - if (close(fd) < 0) ABORT("Couldnt close /proc file"); + if (close(fd) < 0) ABORT("Couldn't close /proc file"); fd = -1; } @@ -780,7 +780,9 @@ GC_INNER void GC_register_dynamic_libraries(void) # if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32) -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif # define NOSERVICE # include # include diff --git a/extra/threadlibs.c b/extra/threadlibs.c index 3b148bbd..b14b8a7f 100644 --- a/extra/threadlibs.c +++ b/extra/threadlibs.c @@ -74,8 +74,8 @@ int main(void) # if defined(GC_OSF1_THREADS) printf("-pthread -lrt"); /* DOB: must be -pthread, not -lpthread */ # endif - /* You need GCC 3.0.3 to build this one! */ - /* DG/UX native gcc doesnt know what "-pthread" is */ + /* You need GCC 3.0.3 to build this one! */ + /* DG/UX native gcc doesn't know what "-pthread" is */ # if defined(GC_DGUX386_THREADS) printf("-ldl -pthread\n"); # endif diff --git a/misc.c b/misc.c index 3cec690b..0c276f4f 100644 --- a/misc.c +++ b/misc.c @@ -27,7 +27,9 @@ # include #endif #if defined(MSWIN32) || defined(MSWINCE) -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif # define NOSERVICE # include #endif diff --git a/os_dep.c b/os_dep.c index 1e651247..13dda9e5 100644 --- a/os_dep.c +++ b/os_dep.c @@ -79,7 +79,9 @@ #endif #if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32) -# define WIN32_LEAN_AND_MEAN +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif # define NOSERVICE # include /* It's not clear this is completely kosher under Cygwin. But it */ diff --git a/pthread_support.c b/pthread_support.c index e2e09006..7ff0c673 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -1077,7 +1077,7 @@ GC_API int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval) LOCK(); thread_gc_id = GC_lookup_thread(thread); /* This is guaranteed to be the intended one, since the thread id */ - /* cant have been recycled by pthreads. */ + /* can't have been recycled by pthreads. */ UNLOCK(); result = REAL_FUNC(pthread_join)(thread, retval); # if defined (GC_FREEBSD_THREADS) diff --git a/tests/test.c b/tests/test.c index 783d82f2..49cfd24f 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1614,8 +1614,8 @@ int main(void) int i; # ifdef GC_IRIX_THREADS /* Force a larger stack to be preallocated */ - /* Since the initial cant always grow later. */ - *((volatile char *)&code - 1024*1024) = 0; /* Require 1 Mb */ + /* Since the initial can't always grow later. */ + *((volatile char *)&code - 1024*1024) = 0; /* Require 1 MB */ # endif /* GC_IRIX_THREADS */ # if defined(GC_HPUX_THREADS) /* Default stack size is too small, especially with the 64 bit ABI */ -- 2.40.0