Commit f443ae81 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5a975bb4
......@@ -34,20 +34,26 @@ cdef extern from "bigfile/_bigfile.h":
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object PyBigFile]:
pass
"""
# FIXME hack, keep in sync with PyBigFile
cdef extern from *:
"""
#include <wendelin/bigfile/file.h>
#include <wendelin/bigfile/virtmem.h>
struct cxxPyBigFile {
PyObject pyobj;
BigFile file;
};
"""
struct cxxPyBigFile:
## FIXME hack, keep in sync with PyBigFile
#cdef extern from *:
# """
# #include <wendelin/bigfile/file.h>
# #include <wendelin/bigfile/virtmem.h>
#
# struct cxxPyBigFile {
# PyObject pyobj;
# BigFile file;
# };
# """
# struct cxxPyBigFile:
# pass
# ctypedef extern class wendelin.bigfile._bigfile.BigFile[object cxxPyBigFile]:
# pass
cdef extern from "bigfile/_bigfile.h":
struct PyBigFile:
pass
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object cxxPyBigFile]:
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object PyBigFile]:
pass
import wcfs as pywcfs
......@@ -66,8 +72,8 @@ from wendelin.lib.zodb import zconn_at
# XXX + wcfs
cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
cdef object zself # reference to ZBigFile
cdef wcfs.Oid foid # = .zself._p_oid
cdef wcfs.FileH wfileh # WCFS file handle
# cdef wcfs.Oid foid # = .zself._p_oid
cdef wcfs.FileH wfileh # WCFS file handle. Initially nil, opened by blkmmapper
# XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
@staticmethod
......@@ -75,7 +81,7 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize)
obj.zself = zself
# obj.foid = -1 # Note: zself._p_oid could be yet None for newly created ZBigFile
obj.wfileh = nil # opened by blkmmapper
obj.wfileh = nil
return obj
def __dealloc__(_ZBigFile zf):
......@@ -100,10 +106,12 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
# zf.foid = u64(zf.zself._p_oid)
# join zconn to wconn; link to wconn from _ZBigFile
pywconn = pywconnOf(zconn)
pywfileh = pywconn.open(zf.zself._p_oid)
pywconn = pywconnOf(zconn)
pywfileh = pywconn.open(zf.zself._p_oid)
zf.wfileh = pywfileh.wfileh
# return XXX
# functions that we give to virtmem bigfile_ops .mmap*
cdef extern from * nogil:
......
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