Author: Armin Rigo <[email protected]>
Branch:
Changeset: r314:c43233de7f0e
Date: 2013-06-28 11:17 +0200
http://bitbucket.org/pypy/stmgc/changeset/c43233de7f0e/
Log: Test and fix
diff --git a/c4/nursery.c b/c4/nursery.c
--- a/c4/nursery.c
+++ b/c4/nursery.c
@@ -646,7 +646,8 @@
}
/* Are we at the end of the nursery? */
- if (d->nursery_nextlimit == d->nursery_end) {
+ if (d->nursery_nextlimit == d->nursery_end ||
+ d->nursery_current == d->nursery_end) { // stmgc_minor_collect_soon()
/* Yes */
if (tid == -1)
return NULL; /* cannot collect */
diff --git a/c4/test/support.py b/c4/test/support.py
--- a/c4/test/support.py
+++ b/c4/test/support.py
@@ -73,6 +73,7 @@
void stm_add_prebuilt_root(gcptr);
void stm_clear_between_tests(void);
void stmgc_minor_collect(void);
+ void stmgc_minor_collect_soon(void);
gcptr _stm_nonrecord_barrier(gcptr);
int _stm_is_private(gcptr);
void stm_start_sharedlock(void);
diff --git a/c4/test/test_nursery.py b/c4/test/test_nursery.py
--- a/c4/test/test_nursery.py
+++ b/c4/test/test_nursery.py
@@ -301,3 +301,7 @@
for words in range(80):
p1 = nalloc(HDR + words * WORD)
# assert did not crash
+
+def test_collect_soon():
+ lib.stmgc_minor_collect_soon()
+ nalloc(HDR)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit