diff options
author | Jo Shields <directhex@apebox.org> | 2013-10-17 14:22:56 +0100 |
---|---|---|
committer | Jo Shields <directhex@apebox.org> | 2013-10-17 14:22:56 +0100 |
commit | b5c7654dd78182fdb806f0558b71aa37c8d05cd4 (patch) | |
tree | e6c40084b490e91590658a7914ca2e75b768718b /libgc | |
parent | fb760275736ee20c5ba59c61ef6bb2f7fb1f8955 (diff) | |
parent | d0a215f5626219ff7927f576588a777e5331c7be (diff) | |
download | mono-b5c7654dd78182fdb806f0558b71aa37c8d05cd4.tar.gz |
Merge branch 'upstream-experimental' into master-experimental-patches/kfreebsd_support
Diffstat (limited to 'libgc')
-rw-r--r-- | libgc/alloc.c | 2 | ||||
-rw-r--r-- | libgc/include/private/gc_locks.h | 40 | ||||
-rw-r--r-- | libgc/obj_map.c | 2 | ||||
-rw-r--r-- | libgc/ptr_chck.c | 2 |
4 files changed, 6 insertions, 40 deletions
diff --git a/libgc/alloc.c b/libgc/alloc.c index 9ec6992352..b6bc1832c9 100644 --- a/libgc/alloc.c +++ b/libgc/alloc.c @@ -969,7 +969,7 @@ word n; } # endif expansion_slop = WORDS_TO_BYTES(min_words_allocd()) + 4*MAXHINCR*HBLKSIZE; - if (GC_last_heap_addr == 0 && !((word)space & SIGNB) + if ((GC_last_heap_addr == 0 && !((word)space & SIGNB)) || (GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space)) { /* Assume the heap is growing up */ GC_greatest_plausible_heap_addr = diff --git a/libgc/include/private/gc_locks.h b/libgc/include/private/gc_locks.h index e95cec0b4c..ba4fd185b9 100644 --- a/libgc/include/private/gc_locks.h +++ b/libgc/include/private/gc_locks.h @@ -231,46 +231,12 @@ # define NACL_ALIGN() # endif inline static int GC_test_and_set(volatile unsigned int *addr) { -#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) - int ret, tmp; - __asm__ __volatile__ ( - "1:\n" - NACL_ALIGN() - MASK_REGISTER("%3", "al") - "ldrex %0, [%3]\n" - MASK_REGISTER("%3", "al") - "strex %1, %2, [%3]\n" - "teq %1, #0\n" - "bne 1b\n" - : "=&r" (ret), "=&r" (tmp) - : "r" (1), "r" (addr) - : "memory", "cc"); - return ret; -#else - int oldval; - /* SWP on ARM is very similar to XCHG on x86. Doesn't lock the - * bus because there are no SMP ARM machines. If/when there are, - * this code will likely need to be updated. */ - /* See linuxthreads/sysdeps/arm/pt-machine.h in glibc-2.1 */ - __asm__ __volatile__(MASK_REGISTER("%2", "al") - "swp %0, %1, [%2]" - : "=&r"(oldval) - : "r"(1), "r"(addr) - : "memory"); - return oldval; -#endif + return (int) __sync_lock_test_and_set (addr, 1); } # define GC_TEST_AND_SET_DEFINED inline static void GC_clear(volatile unsigned int *addr) { -#ifdef HAVE_ARMV6 - /* Memory barrier */ -#ifdef __native_client__ - /* NaCl requires ARMv7 CPUs. */ - __asm__ __volatile__("dsb" : : : "memory"); -#else - __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); -#endif -#endif + __sync_synchronize (); + *(addr) = 0; } # define GC_CLEAR_DEFINED diff --git a/libgc/obj_map.c b/libgc/obj_map.c index 39993451cc..49f6add155 100644 --- a/libgc/obj_map.c +++ b/libgc/obj_map.c @@ -22,7 +22,7 @@ # include "private/gc_priv.h" map_entry_type * GC_invalid_map = 0; -static max_valid_offset = 0; +static word max_valid_offset = 0; /* Invalidate the object map associated with a block. Free blocks */ /* are identified by invalid maps. */ diff --git a/libgc/ptr_chck.c b/libgc/ptr_chck.c index d83d730d34..621a45f034 100644 --- a/libgc/ptr_chck.c +++ b/libgc/ptr_chck.c @@ -165,7 +165,7 @@ void (*GC_is_valid_displacement_print_proc) GC_PROTO((GC_PTR)) = pdispl = HBLKDISPL(p); map_entry = MAP_ENTRY((hhdr -> hb_map), pdispl); if (map_entry == OBJ_INVALID - || sz > MAXOBJBYTES && (ptr_t)p >= (ptr_t)h + sz) { + || (sz > MAXOBJBYTES && (ptr_t)p >= (ptr_t)h + sz)) { goto fail; } return(p); |