Author: Nicolas Truessel <[email protected]>
Branch: quad-color-gc
Changeset: r86418:d4fd1b5588ee
Date: 2016-08-22 16:21 +0200
http://bitbucket.org/pypy/pypy/changeset/d4fd1b5588ee/
Log: Stop trying to set tid via c code as it does not work
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
@@ -32,23 +32,21 @@
ll_assert(not needs_finalizer, 'finalizer not supported')
ll_assert(not is_finalizer_light, 'light finalizer not supported')
ll_assert(not contains_weakptr, 'weakref not supported')
+ # FIXME: set typeid and hash here
return llop.qcgc_allocate(llmemory.GCREF, size, typeid)
def malloc_varsize_clear(self, typeid16, length, size, itemsize,
offset_to_length):
totalsize = size + itemsize * length
- totalsize = llarena.round_up_for_allocation(totalsize)
+ #totalsize = llarena.round_up_for_allocation(totalsize)
obj = llop.qcgc_allocate(llmemory.Address, totalsize, typeid16)
(obj + offset_to_length).signed[0] = length
return llmemory.cast_adr_to_ptr(obj, llmemory.GCREF)
def collect(self, gen=1):
"""Do a minor (gen=0) or major (gen>0) collection."""
- raise NotImplementedError
- #if gen > 0:
- # llop.stm_major_collect(lltype.Void)
- #else:
- # llop.stm_minor_collect(lltype.Void)
+ # XXX: Minor collection not supported
+ llop.qcgc_collect(lltype.Void)
def writebarrier_before_copy(self, source_addr, dest_addr,
source_start, dest_start, length):
diff --git a/rpython/rtyper/lltypesystem/lloperation.py
b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -516,6 +516,7 @@
# __________ qcgc operations __________
'qcgc_allocate': LLOp(canmallocgc=True),
+ 'qcgc_collect': LLOp(), # XXX: No allocations, so no canmallocgc ?
# __________ weakrefs __________
diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -956,5 +956,7 @@
size = self.expr(op.args[0])
typeid = self.expr(op.args[1])
result = self.expr(op.result)
- return ('%s = qcgc_allocate(%s);' % (result, size) +
- '((pypyhdr_t *)%s)->tid = %s;' % (result, typeid))
+ return '%s = qcgc_allocate(%s);' % (result, size)
+
+ def OP_QCGC_COLLECT(self, op):
+ return 'qcgc_collect();'
diff --git a/rpython/translator/c/src/g_prerequisite.h
b/rpython/translator/c/src/g_prerequisite.h
--- a/rpython/translator/c/src/g_prerequisite.h
+++ b/rpython/translator/c/src/g_prerequisite.h
@@ -23,11 +23,3 @@
# define RPY_LENGTH0 1 /* array decl [0] are bad */
# define RPY_DUMMY_VARLENGTH /* nothing */
#endif
-
-#ifdef RPY_QCGC
-typedef struct {
- object_t hdr;
- int32_t tid;
- int32_t hash;
-} pypyhdr_t;
-#endif
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit