2014-09-13 05:14:43 +04:00
|
|
|
from libc.stdint cimport uint64_t
|
2014-09-18 01:09:24 +04:00
|
|
|
from cymem.cymem cimport Address
|
2014-09-13 05:14:43 +04:00
|
|
|
|
|
|
|
ctypedef uint64_t key_t
|
2014-09-13 19:29:58 +04:00
|
|
|
ctypedef void* val_t
|
2014-09-13 04:02:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
cdef struct Cell:
|
|
|
|
key_t key
|
|
|
|
val_t value
|
|
|
|
|
|
|
|
|
|
|
|
cdef class PointerHash:
|
|
|
|
cdef size_t size
|
|
|
|
cdef size_t filled
|
|
|
|
cdef Cell* cells
|
2014-09-17 22:02:26 +04:00
|
|
|
cdef Address _mem
|
2014-09-13 04:02:41 +04:00
|
|
|
|
2014-09-15 07:03:44 +04:00
|
|
|
cdef val_t get(self, key_t key) nogil
|
2014-09-13 19:29:58 +04:00
|
|
|
cdef void set(self, key_t key, val_t value) except *
|
2014-09-13 18:43:42 +04:00
|
|
|
cdef void resize(self, size_t new_size) except *
|