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

.

parent bf3c302b
...@@ -50,23 +50,20 @@ cdef extern from *: ...@@ -50,23 +50,20 @@ cdef extern from *:
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object CXXPyBigFile]: ctypedef extern class wendelin.bigfile._bigfile.BigFile[object CXXPyBigFile]:
pass pass
# helper for ZBigFile - just redirect loadblk/storeblk back # helper for ZBigFile - just redirect loadblk/storeblk back
# (because it is not possible to inherit from both Persistent and BigFile at # (because it is not possible to inherit from both Persistent and BigFile at
# the same time - see below) # the same time - see below)
cdef class _ZBigFile(BigFile): cdef class _ZBigFile(BigFile):
# .zself - reference to ZBigFile #cdef class _ZBigFile:
cdef object zself # reference to ZBigFile
""" # XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
def __new__(cls, zself, blksize): @staticmethod
obj = BigFile.__new__(cls, blksize) def _new(zself, blksize):
cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize)
obj.zself = zself obj.zself = zself
return obj return obj
"""
def __cinit__(self, zself, blksize):
BigFile.__cinit__(self, blksize)
self.zself = zself
# redirect load/store/mapper to main class # redirect load/store/mapper to main class
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf) def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
......
...@@ -546,7 +546,7 @@ class ZBigFile(LivePersistent): ...@@ -546,7 +546,7 @@ class ZBigFile(LivePersistent):
def __setstate__(self, state): def __setstate__(self, state):
self.blksize, self.blktab = 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() self._v_filehset = WeakSet()
......
...@@ -268,7 +268,6 @@ setup( ...@@ -268,7 +268,6 @@ setup(
PyGoExt('wendelin.bigfile._file_zodb', PyGoExt('wendelin.bigfile._file_zodb',
['bigfile/_file_zodb.pyx'], ['bigfile/_file_zodb.pyx'],
extra_compile_args = [ extra_compile_args = [
'-fplan9-extensions', # anonymous-structs + simple inheritance
'-std=gnu++11', # not c++11 since we use typeof '-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