[pypy-commit] pypy stm-gc: Start to re-enable test_stmgcintf.
arigo
noreply at buildbot.pypy.org
Sun Apr 22 23:00:02 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54631:05577eabf224
Date: 2012-04-22 20:58 +0200
http://bitbucket.org/pypy/pypy/changeset/05577eabf224/
Log: Start to re-enable test_stmgcintf.
diff --git a/pypy/translator/stm/src_stm/et.h b/pypy/translator/stm/src_stm/et.h
--- a/pypy/translator/stm/src_stm/et.h
+++ b/pypy/translator/stm/src_stm/et.h
@@ -9,7 +9,6 @@
#define _ET_H
#include <setjmp.h>
-#include "src/commondefs.h"
/* see comments in ../stmgcintf.py */
@@ -29,7 +28,7 @@
and from the GC (see llop.nop(...)) */
extern void pypy_g__stm_thread_starting(void);
extern void pypy_g__stm_thread_stopping(void);
-extern void *_stm_run_transaction(void *, long);
+extern void *pypy_g__stm_run_transaction(void *, long);
extern long pypy_g__stm_getsize(void *);
extern void pypy_g__stm_enum_callback(void *, void *, void *);
diff --git a/pypy/translator/stm/stmgcintf.py b/pypy/translator/stm/stmgcintf.py
--- a/pypy/translator/stm/stmgcintf.py
+++ b/pypy/translator/stm/stmgcintf.py
@@ -13,7 +13,6 @@
includes = ['src_stm/et.h'],
pre_include_bits = ['#define PYPY_LONG_BIT %d' % LONG_BIT,
'#define RPY_STM 1'],
- separate_module_sources = ['\n'], # hack for test_rffi_stm
)
def _llexternal(name, args, result, **kwds):
diff --git a/pypy/translator/stm/test/getlib.py b/pypy/translator/stm/test/getlib.py
new file mode 100644
--- /dev/null
+++ b/pypy/translator/stm/test/getlib.py
@@ -0,0 +1,51 @@
+from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from pypy.translator.stm.stmgcintf import eci
+
+
+src_code = r'''
+
+struct pypy_header0 {
+ long h_tid;
+ void *h_version;
+};
+
+struct pypy_pypy_rlib_rstm_Transaction0 {
+ struct pypy_header0 header;
+ struct pypy_pypy_rlib_rstm_Transaction0 *t_inst__next_transaction;
+};
+
+
+#include "src_stm/et.h"
+#include "src_stm/et.c"
+
+
+void (*stm_thread_starting)(void);
+void (*stm_thread_stopping)(void);
+void *(*stm_run_transaction)(void *, long);
+long (*stm_getsize)(void *);
+void (*stm_enum_callback)(void *, void *, void *);
+
+
+void pypy_g__stm_thread_starting(void) {
+ stm_thread_starting();
+}
+void pypy_g__stm_thread_stopping(void) {
+ stm_thread_stopping();
+}
+void *pypy_g__stm_run_transaction(void *a, long b) {
+ return stm_run_transaction(a, b);
+}
+long pypy_g__stm_getsize(void *a) {
+ return stm_getsize(a);
+}
+void pypy_g__stm_enum_callback(void *a, void *b, void *c) {
+ stm_enum_callback(a, b, c);
+}
+'''
+
+
+assert not hasattr(eci, '_with_ctypes')
+
+eci._with_ctypes = eci.merge(ExternalCompilationInfo(
+ separate_module_sources = [src_code],
+ ))
diff --git a/pypy/translator/stm/test/test_stmgcintf.py b/pypy/translator/stm/test/test_stmgcintf.py
--- a/pypy/translator/stm/test/test_stmgcintf.py
+++ b/pypy/translator/stm/test/test_stmgcintf.py
@@ -2,6 +2,7 @@
from pypy.rpython.lltypesystem import lltype, llmemory, rffi
from pypy.rpython.annlowlevel import llhelper
from pypy.translator.stm.stmgcintf import StmOperations
+from pypy.translator.stm.test import getlib # for the side-effects
from pypy.rpython.memory.gc import stmgc
WORD = stmgc.WORD
More information about the pypy-commit
mailing list