Author: Armin Rigo <[email protected]>
Branch: ec-threadlocal
Changeset: r72160:bb24a270b876
Date: 2014-06-23 13:28 +0200
http://bitbucket.org/pypy/pypy/changeset/bb24a270b876/
Log: Oops, documented but forgot to call _make_sure_does_not_move()
diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -313,7 +313,9 @@
assert isinstance(value, Cls) or value is None
if we_are_translated():
from rpython.rtyper.annlowlevel import
cast_instance_to_base_ptr
+ from rpython.rlib.rgc import _make_sure_does_not_move
ptr = cast_instance_to_base_ptr(value)
+ _make_sure_does_not_move(ptr)
llop.threadlocalref_set(lltype.Void, opaque_id, ptr)
else:
self.local.value = value
diff --git a/rpython/rlib/test/test_rthread.py
b/rpython/rlib/test/test_rthread.py
--- a/rpython/rlib/test/test_rthread.py
+++ b/rpython/rlib/test/test_rthread.py
@@ -222,6 +222,7 @@
def f():
x1 = FooBar()
t.set(x1)
+ import gc; gc.collect()
assert t.get() is x1
return 42
fn = self.getcompiled(f, [])
@@ -238,4 +239,4 @@
gcpolicy = 'boehm'
class TestUsingFramework(AbstractThreadTests):
- gcpolicy = 'generation'
+ gcpolicy = 'minimark'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit