- 13 Jan, 2017 1 commit
-
-
Marius Gedminas authored
-
- 12 Jan, 2017 2 commits
-
-
Marius Gedminas authored
-
Marius Gedminas authored
-
- 22 Dec, 2016 1 commit
-
-
Jason Madden authored
new_ghost shouldn't clear newargs (PyPy consistent with C)
-
- 20 Dec, 2016 1 commit
-
-
Jason Madden authored
Expose PersistentList/Mapping docs. Fixes #52.
-
- 19 Dec, 2016 9 commits
-
-
Jason Madden authored
-
Jason Madden authored
-
Jason Madden authored
PickleCache. Fixes #49. Unfortunately, this doesn't fix the whole problem, because _p_deactivate() still clears them, and so we lose what we set in __new__.
-
Jason Madden authored
-
Jason Madden authored
@jimfulton and I have talked about it, and I'm (mostly :) convinced that this shouldn't be an actual problem for any of the reasons described in the previous comment. If I use PyPy 5.4.1 to run the ZODB master test suite against this (well, with #44 rolled back) I don't get any unexpected failures. (I haven't run the ZEO test suite yet.) Which honestly amazes me because I'm sure I used to get test failures---I guess the PyPy GC has changed...which means we may see some failures on Travis. I'll try to set up an older PyPy to verify.
-
Jason Madden authored
Fix Python timestamp hash on 64-bit windows
-
Jason Madden authored
This reverts commit 358cd618. The _wraparound function is still broken on PyPy3 (both the old version on Travis and the latest available) if we don't use ctypes.
-
Jason Madden authored
-
Jason Madden authored
Fixes #51 Part of the problem was in the tests. The detection of when the hash gets truncated was broken on win32. Part of the problem is somewhere in the _wraparound function, I think, because even fixing the tests to use the right values we still get mismatches. Rather than dig into that, I just go back to using ctypes when it's available.
-
- 29 Nov, 2016 5 commits
-
-
Jim Fulton authored
-
Jim Fulton authored
py/deactivate vs slots: A slot variable could not be initialized at all
-
Kirill Smelkov authored
fe2219f4 (On deactivate release in-slots objects too) started to release objects from slotted variables but was not careful enough while doing so: we have to be careful while deleting as for unset variables it will raise AttributeError: class C(object): __slots__ = ['aaa', 'unset'] def __init__(self, aaa): self.aaa = 1 c = C(111) del c.aaa del c.unset Traceback (most recent call last): File "y.py", line 9, in <module> del c.unset AttributeError: unset Caught by preparing fix for https://github.com/zopefoundation/persistent/pull/44#issuecomment-256768600 C version already have this protection in the original fe2219f4 patch: + if (PyObject_GenericSetAttr((PyObject *)self, name, NULL) < 0) + /* delattr of non-set slot will raise AttributeError - we + * simply ignore. */ + PyErr_Clear();
-
Jim Fulton authored
On deactivate release in-slots objects only for classes that don't ov…
-
Kirill Smelkov authored
Commit fe2219f4 taught Persistent to release in-slots objects on deactivation. That however broke pure-python implementation of many things because they were using __slots__ as a place which survive deactivation. As per discussion in https://github.com/zopefoundation/persistent/pull/44 and resolution: https://github.com/zopefoundation/persistent/pull/44#issuecomment-261019084 let's try to preserve backward compatibility by not releasing slots for classes that override __new__ /proposed-by-and-helped @jimfulton
-
- 15 Nov, 2016 2 commits
-
-
Tres Seaver authored
-
Tres Seaver authored
-
- 10 Aug, 2016 6 commits
-
-
Tres Seaver authored
[ci skip]
-
Tres Seaver authored
Get rid of ctypes dependency to make persistent more pure-python compatible. Update PR's branch to fix tests under Py3k / pypy3.
-
Tres Seaver authored
- Use 'sys.maxsize' rather than 'sys.maxint' for Py3k compatibility. - Define it as a module constant, and patch it locally in tests, rather than patching 'sys'. - Call 'c.__hash__()' directly in 'test_hash_equal_constants' to work around odd truncation behavior of 'hash()' builtin in pypy3.
-
-
Tres Seaver authored
[ci skip]
-
Tres Seaver authored
On deactivate release in-slots objects too
-
- 21 Jul, 2016 1 commit
-
-
Kirill Smelkov authored
On ._p_deactivate() and ._p_invalidate(), when an object goes to ghost state, objects referenced by all its attributes, except related to persistence machinery, are released, this way freeing memory (if they were referenced only from going-to-ghost object). That's the idea - an object in ghost state is simply a stub, which loads its content on first access (via hooking into get/set attr) while occupying minimal memory in not-yet-loaded state. However the above is not completely true right now, as currently on ghostification only object's .__dict__ is released, while in-slots objects are retained attached to ghost object staying in RAM: ---- 8< ---- from ZODB import DB from persistent import Persistent import gc db = DB(None) jar = db.open() class C: def __init__(self, v): self.v = v def __del__(self): print 'released (%s)' % self.v class P1(Persistent): pass class P2(Persistent): __slots__ = ('aaa') p1 = P1() jar.add(p1) p1.aaa = C(1) p2 = P2() jar.add(p2) p2.aaa = C(2) p1._p_invalidate() # "released (1)" is printed p2._p_invalidate() gc.collect() # "released (2)" is NOT printed <-- ---- 8< ---- So teach ghostify() & friends to release objects in slots to free-up memory when an object goes to ghost state. NOTE PyErr_Occurred() added after ghostify() calls because pickle_slotnames() can raise an error, but we do not want to change ghostify() prototype for backward compatibility reason - as it is used in cPersistenceCAPIstruct. ( I hit this bug with wendelin.core which uses proxies to load data from DB to virtual memory manager and then deactivate proxy right after load has been completed: https://lab.nexedi.com/nexedi/wendelin.core/blob/f7803634/bigfile/file_zodb.py#L239 https://lab.nexedi.com/nexedi/wendelin.core/blob/f7803634/bigfile/file_zodb.py#L295 )
-
- 26 May, 2016 5 commits
-
-
Tres Seaver authored
-
Tres Seaver authored
-
Tres Seaver authored
Fix #38 by returning the correct type from TimeStamp_hash.
-
Jason Madden authored
-
Jason Madden authored
-
- 24 May, 2016 1 commit
-
-
Marius Gedminas authored
CI for travis and appveyor
-
- 22 May, 2016 1 commit
-
-
Forest Gregg authored
-
- 18 May, 2016 3 commits
-
-
Forest Gregg authored
-
Forest Gregg authored
-
Forest Gregg authored
-
- 05 May, 2016 2 commits
-
-
Jim Fulton authored
-
Jim Fulton authored
TimeStamp: sub-second precision for Python implementation of timeTime()
-