Author: Nicolas Truessel <[email protected]>
Branch: quad-color-gc
Changeset: r86350:399683dc9715
Date: 2016-08-20 17:41 +0200
http://bitbucket.org/pypy/pypy/changeset/399683dc9715/

Log:    qcgc_allocate seems to compile

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
@@ -17,7 +17,7 @@
 
     TRANSLATION_PARAMS = {}
     HDR = lltype.Struct(
-            'PYPYHDR',
+            'pypyhdr_t',
             ('hdr', rffi.COpaque('object_t', hints={"is_qcgc_header": True})),
             ('tid', lltype.Signed),
             ('hash', lltype.Signed))
diff --git a/rpython/rtyper/tool/rffi_platform.py 
b/rpython/rtyper/tool/rffi_platform.py
--- a/rpython/rtyper/tool/rffi_platform.py
+++ b/rpython/rtyper/tool/rffi_platform.py
@@ -896,6 +896,7 @@
     eci = ExternalCompilationInfo(
             include_dirs = [library_dir],
             includes = ["qcgc.h"],
+            pre_include_bits = ["#define RPY_QCGC 1"],
             separate_module_sources = [separate_source],  # XXX
             separate_module_files = [os.path.join(library_dir, f) for f in
                 ["qcgc.c", "arena.c", "allocator.c", "bag.c", "event_logger.c",
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
@@ -957,4 +957,4 @@
         typeid = self.expr(op.args[1])
         result = self.expr(op.result)
         return ('%s = qcgc_allocate(%s);' % (result, size) +
-                '((PYPYHDR *)%s)->tid = %s;' % (result, typeid))
+                '((pypyhdr_t *)%s)->tid = %s;' % (result, typeid))
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,3 +23,11 @@
 # 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

Reply via email to