Commit 1f8d5d1c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4c272bf6
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Wendelin.bigfile | BigFile ZODB backend # Wendelin.bigfile | WCFS part of BigFile ZODB backend
# Copyright (C) 2014-2019 Nexedi SA and Contributors. # Copyright (C) 2014-2019 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
...@@ -53,11 +53,14 @@ cdef extern from *: ...@@ -53,11 +53,14 @@ cdef extern from *:
from wcfs.internal cimport _wcfs as wcfs from wcfs.internal cimport _wcfs as wcfs
from golang cimport nil from golang cimport nil
from ZODB.utils import u64
# 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):
cdef object zself # reference to ZBigFile cdef object zself # reference to ZBigFile
cdef wcfs.Oid foid # = .zself._p_oid
cdef wcfs.Conn wconn # WCFS connection XXX -> zconn instead ? XXX wconn is shared between files cdef wcfs.Conn wconn # WCFS connection XXX -> zconn instead ? XXX wconn is shared between files
# XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__ # XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
...@@ -65,6 +68,8 @@ cdef class _ZBigFile(BigFile): ...@@ -65,6 +68,8 @@ cdef class _ZBigFile(BigFile):
def _new(zself, blksize): def _new(zself, blksize):
cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize) cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize)
obj.zself = zself obj.zself = zself
obj.foid = -1 # Note: zself._p_oid could be yet None for newly created ZBigFile
obj.wconn = nil # XXX
return obj return obj
def __dealloc__(_ZBigFile zf): def __dealloc__(_ZBigFile zf):
......
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