2014-09-13 01:14:43 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
|
|
|
|
ctypedef uint64_t key_t
|
2014-09-13 15:29:58 +00:00
|
|
|
ctypedef void* val_t
|
2014-09-13 00:02:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef struct Cell:
|
|
|
|
key_t key
|
|
|
|
val_t value
|
|
|
|
|
|
|
|
|
|
|
|
cdef class PointerHash:
|
|
|
|
cdef size_t size
|
|
|
|
cdef size_t filled
|
2014-09-13 14:43:42 +00:00
|
|
|
cdef Cell* _last
|
2014-09-13 00:02:41 +00:00
|
|
|
cdef Cell* cells
|
|
|
|
|
2014-09-13 15:29:58 +00:00
|
|
|
cdef val_t get(self, key_t key)
|
|
|
|
cdef void set(self, key_t key, val_t value) except *
|
2014-09-13 14:43:42 +00:00
|
|
|
cdef void resize(self, size_t new_size) except *
|