Commit 5c3038eb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d64280c6
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
# pinner) is verified when running wendelin.core array tests in wcfs mode. # pinner) is verified when running wendelin.core array tests in wcfs mode.
from golang cimport chan, structZ, string, error, refptr from golang cimport chan, structZ, string, error, refptr
from golang cimport context from golang cimport context, cxx
from libc.stdint cimport int64_t, uint64_t, uint8_t from libc.stdint cimport int64_t, uint64_t, uint8_t
from libcpp.utility cimport pair from libcpp.utility cimport pair
...@@ -123,6 +123,9 @@ cdef extern from "wcfs/internal/wcfs.h" namespace "wcfs" nogil: ...@@ -123,6 +123,9 @@ cdef extern from "wcfs/internal/wcfs.h" namespace "wcfs" nogil:
void unmap "_ptr()->unmap" () void unmap "_ptr()->unmap" ()
cxx.dict[int64_t, Tid] _tfileh_pinned(FileH wfileh)
# ---- python bits ---- # ---- python bits ----
cdef class PyWCFS: cdef class PyWCFS:
......
...@@ -33,6 +33,7 @@ cdef extern from *: ...@@ -33,6 +33,7 @@ cdef extern from *:
from ZODB.utils import p64, u64 from ZODB.utils import p64, u64
from cpython cimport PyBuffer_FillInfo from cpython cimport PyBuffer_FillInfo
from libcpp.unordered_map cimport unordered_map
# XXX hack, why it is needed? (likely top-level wendelin.* redirector # XXX hack, why it is needed? (likely top-level wendelin.* redirector
#from wcfs.internal._wcfs cimport * #from wcfs.internal._wcfs cimport *
...@@ -109,6 +110,12 @@ cdef class PyFileH: ...@@ -109,6 +110,12 @@ cdef class PyFileH:
pywmmap.wmmap = wmmap pywmmap.wmmap = wmmap
return pywmmap return pywmmap
# XXX for tests
property pinned:
def __get__(PyFileH pywfileh):
# XXX cast: needed for cython to automatically convert to py dict
return <unordered_map[int64_t, Tid]> _tfileh_pinned(pywfileh.wfileh)
cdef class PyMapping: cdef class PyMapping:
......
...@@ -595,4 +595,8 @@ void _Mapping::decref() { ...@@ -595,4 +595,8 @@ void _Mapping::decref() {
} }
dict<int64_t, zodb::Tid> _tfileh_pinned(FileH fileh) {
return fileh->_pinned;
}
} // wcfs:: } // wcfs::
...@@ -187,6 +187,10 @@ public: ...@@ -187,6 +187,10 @@ public:
}; };
// for testing
dict<int64_t, zodb::Tid> _tfileh_pinned(FileH fileh);
} // wcfs:: } // wcfs::
#endif #endif
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