From: ivmai Date: Tue, 19 Apr 2011 11:27:58 +0000 (+0000) Subject: 2011-04-19 Ivan Maidanski X-Git-Tag: gc7_2alpha6~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7dc8fe712e7a11ae12ce9ec2b1f3f6faf068f4b;p=gc 2011-04-19 Ivan Maidanski * include/private/gc_priv.h (_GNU_SOURCE): Include features.h first (except for NaCl) and then define the macro to 1 if not yet. --- diff --git a/ChangeLog b/ChangeLog index cf253592..9079f5a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-04-19 Ivan Maidanski + + * include/private/gc_priv.h (_GNU_SOURCE): Include features.h + first (except for NaCl) and then define the macro to 1 if not yet. + 2011-04-18 Ivan Maidanski (really Ludovic Courtes) * tests/tests.am (TESTS, check_PROGRAMS): Add diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index df8bd04d..b1bb9c78 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -26,11 +26,15 @@ # define GC_BUILD #endif -#if (defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)) \ - && !defined(_GNU_SOURCE) +#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) /* Can't test LINUX, since this must be defined before other includes. */ -# define _GNU_SOURCE -#endif +# if !defined(__native_client__) +# include +# endif +# ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# endif +#endif /* __linux__ */ #if (defined(DGUX) && defined(GC_THREADS) || defined(DGUX386_THREADS) \ || defined(GC_DGUX386_THREADS)) && !defined(_USING_POSIX4A_DRAFT10) @@ -1355,15 +1359,16 @@ struct GC_traced_stack_sect_s { #ifdef USE_MARK_BYTES # define mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n]) -# define set_mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n] = 1) -# define clear_mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n] = 0) +# define set_mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n]) = 1 +# define clear_mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n]) = 0 #else /* !USE_MARK_BYTES */ -# define mark_bit_from_hdr(hhdr,n) \ - (((hhdr)->hb_marks[divWORDSZ(n)] >> (modWORDSZ(n))) & (word)1) +# define mark_bit_from_hdr(hhdr,n) (((hhdr)->hb_marks[divWORDSZ(n)] \ + >> (modWORDSZ(n))) & (word)1) # define set_mark_bit_from_hdr(hhdr,n) \ - OR_WORD((hhdr)->hb_marks+divWORDSZ(n), (word)1 << modWORDSZ(n)) -# define clear_mark_bit_from_hdr(hhdr,n) \ - ((hhdr)->hb_marks[divWORDSZ(n)] &= ~((word)1 << modWORDSZ(n))) + OR_WORD((hhdr)->hb_marks+divWORDSZ(n), \ + (word)1 << modWORDSZ(n)) +# define clear_mark_bit_from_hdr(hhdr,n) (hhdr)->hb_marks[divWORDSZ(n)] \ + &= ~((word)1 << modWORDSZ(n)) #endif /* !USE_MARK_BYTES */ #ifdef MARK_BIT_PER_OBJ @@ -1380,8 +1385,8 @@ struct GC_traced_stack_sect_s { # define MARK_BIT_OFFSET(sz) BYTES_TO_GRANULES(sz) # define IF_PER_OBJ(x) # define FINAL_MARK_BIT(sz) \ - ((sz) > MAXOBJBYTES ? MARK_BITS_PER_HBLK \ - : BYTES_TO_GRANULES((sz) * HBLK_OBJS(sz))) + ((sz) > MAXOBJBYTES? MARK_BITS_PER_HBLK \ + : BYTES_TO_GRANULES((sz) * HBLK_OBJS(sz))) #endif /* Important internal collector routines */ @@ -1627,7 +1632,7 @@ GC_INNER void GC_freehblk(struct hblk * p); /* Misc GC: */ GC_INNER GC_bool GC_expand_hp_inner(word n); -GC_INNER void GC_start_reclaim(GC_bool abort_if_found); +GC_INNER void GC_start_reclaim(int abort_if_found); /* Restore unmarked objects to free */ /* lists, or (if abort_if_found is */ /* TRUE) report them. */