Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r1618:e5d94f869b43 Date: 2015-02-13 16:18 +0100 http://bitbucket.org/pypy/stmgc/changeset/e5d94f869b43/
Log: Test for 6d9efeaf307b diff --git a/c7/test/support.py b/c7/test/support.py --- a/c7/test/support.py +++ b/c7/test/support.py @@ -184,6 +184,8 @@ stm_hashtable_t *_get_hashtable(object_t *obj); uintptr_t _get_entry_index(stm_hashtable_entry_t *entry); object_t *_get_entry_object(stm_hashtable_entry_t *entry); + +object_t *stm_allocate_preexisting(ssize_t size_rounded_up, struct object_s *); """) diff --git a/c7/test/test_gcpage.py b/c7/test/test_gcpage.py --- a/c7/test/test_gcpage.py +++ b/c7/test/test_gcpage.py @@ -247,3 +247,16 @@ p1 = self.pop_root() assert stm_get_char(p1) == 'o' assert stm_get_char(p2) == 't' + + def test_allocate_preexisting(self): + self.start_transaction() + p1 = stm_allocate(32) + stm_set_char(p1, 'X') + rawaddr = stm_get_real_address(p1) + p2 = lib.stm_allocate_preexisting(32, rawaddr) + # + assert stm_get_char(p2) == 'X' + # + self.switch(1) + self.start_transaction() + assert stm_get_char(p2) == 'X' _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit