Author: Nicolas Truessel <ntrues...@njsm.de> Branch: quad-color-gc Changeset: r87058:253023b456c9 Date: 2016-09-13 09:30 +0200 http://bitbucket.org/pypy/pypy/changeset/253023b456c9/
Log: Update qcgc codebase (bugfix) diff --git a/rpython/memory/gc/qcgc.py b/rpython/memory/gc/qcgc.py --- a/rpython/memory/gc/qcgc.py +++ b/rpython/memory/gc/qcgc.py @@ -12,7 +12,7 @@ _alloc_flavor_ = "raw" moving_gc = False needs_write_barrier = True - malloc_zero_filled = True + malloc_zero_filled = False prebuilt_gc_objects_are_static_roots = True # XXX: ? can_usually_pin_objects = False object_minimal_size = 0 @@ -32,7 +32,7 @@ hdr.tid = llop.combine_ushort(lltype.Signed, typeid, 0) hdr.hash = rffi.cast(lltype.Signed, 0) - def malloc_fixedsize_clear(self, typeid, size, + def malloc_fixedsize(self, typeid, size, needs_finalizer=False, is_finalizer_light=False, contains_weakptr=False): @@ -43,8 +43,7 @@ self.init_gc_object(obj, typeid) return llmemory.cast_adr_to_ptr(obj, llmemory.GCREF) - def malloc_varsize_clear(self, typeid, length, size, itemsize, - offset_to_length): + def malloc_varsize(self, typeid, length, size, itemsize, offset_to_length): if length < 0: raise MemoryError # diff --git a/rpython/memory/gctransform/qcgcframework.py b/rpython/memory/gctransform/qcgcframework.py --- a/rpython/memory/gctransform/qcgcframework.py +++ b/rpython/memory/gctransform/qcgcframework.py @@ -46,7 +46,7 @@ if needs_hash: hdr.hash = lltype.identityhash_nocache(obj._as_ptr()) else: - assert hdr.hash == 0 + hdr.hash = 0 return hdr def push_roots(self, hop, keep_current_args=False): diff --git a/rpython/translator/c/src/qcgc/src/allocator.c b/rpython/translator/c/src/qcgc/src/allocator.c --- a/rpython/translator/c/src/qcgc/src/allocator.c +++ b/rpython/translator/c/src/qcgc/src/allocator.c @@ -137,7 +137,7 @@ memset(result, 0, cells * sizeof(cell_t)); #endif - result->flags |= QCGC_GRAY_FLAG; + result->flags = QCGC_GRAY_FLAG; #if CHECKED assert(qcgc_arena_is_coalesced(qcgc_arena_addr((cell_t *)result))); if (qcgc_allocator_state.bump_state.remaining_cells > 0) { @@ -243,7 +243,7 @@ memset(result, 0, cells * sizeof(cell_t)); #endif - result->flags |= QCGC_GRAY_FLAG; + result->flags = QCGC_GRAY_FLAG; return result; } @@ -260,6 +260,7 @@ memset(result, 0, bytes); #endif qcgc_hbtable_insert(result); + result->flags = QCGC_GRAY_FLAG; return result; } diff --git a/rpython/translator/c/src/qcgc/src/config.h b/rpython/translator/c/src/qcgc/src/config.h --- a/rpython/translator/c/src/qcgc/src/config.h +++ b/rpython/translator/c/src/qcgc/src/config.h @@ -3,7 +3,7 @@ #define CHECKED 0 // Enable runtime sanity checks #define DEBUG_ZERO_ON_SWEEP 0 // Zero memory on sweep (debug only) -#define QCGC_INIT_ZERO 1 // Init new objects with zero bytes +#define QCGC_INIT_ZERO 0 // Init new objects with zero bytes /** * Event logger diff --git a/rpython/translator/c/src/qcgc/src/core.c b/rpython/translator/c/src/qcgc/src/core.c --- a/rpython/translator/c/src/qcgc/src/core.c +++ b/rpython/translator/c/src/qcgc/src/core.c @@ -85,8 +85,7 @@ if (size <= 1<<QCGC_LARGE_ALLOC_THRESHOLD_EXP) { // Use bump / fit allocator - //if (qcgc_allocator_state.use_bump_allocator) { - if (true) { + if (qcgc_allocator_state.use_bump_allocator) { result = qcgc_bump_allocate(size); } else { result = qcgc_fit_allocate(size); _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit