Commit 6235cb9c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bf3c302b
......@@ -50,23 +50,20 @@ cdef extern from *:
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object CXXPyBigFile]:
pass
# helper for ZBigFile - just redirect loadblk/storeblk back
# (because it is not possible to inherit from both Persistent and BigFile at
# the same time - see below)
cdef class _ZBigFile(BigFile):
# .zself - reference to ZBigFile
#cdef class _ZBigFile:
cdef object zself # reference to ZBigFile
"""
def __new__(cls, zself, blksize):
obj = BigFile.__new__(cls, blksize)
# XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
@staticmethod
def _new(zself, blksize):
cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize)
obj.zself = zself
return obj
"""
def __cinit__(self, zself, blksize):
BigFile.__cinit__(self, blksize)
self.zself = zself
# redirect load/store/mapper to main class
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
......
......@@ -546,7 +546,7 @@ class ZBigFile(LivePersistent):
def __setstate__(self, state):
self.blksize, self.blktab = state
self._v_file = _ZBigFile(self, self.blksize)
self._v_file = _ZBigFile._new(self, self.blksize)
self._v_filehset = WeakSet()
......
......@@ -268,7 +268,6 @@ setup(
PyGoExt('wendelin.bigfile._file_zodb',
['bigfile/_file_zodb.pyx'],
extra_compile_args = [
'-fplan9-extensions', # anonymous-structs + simple inheritance
'-std=gnu++11', # not c++11 since we use typeof
]),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment