More tests for the disk cache

This commit is contained in:
Kovid Goyal
2021-01-03 05:07:01 +05:30
parent 18679348b2
commit c869774c58
3 changed files with 64 additions and 13 deletions

View File

@@ -14,6 +14,7 @@ bool remove_from_disk_cache(PyObject *self_, const void *key, size_t key_sz);
void* read_from_disk_cache(PyObject *self_, const void *key, size_t key_sz, void*(allocator)(void*, size_t), void*);
bool disk_cache_wait_for_write(PyObject *self, monotonic_t timeout);
size_t disk_cache_size_on_disk(PyObject *self);
void clear_disk_cache(PyObject *self);
static inline void* disk_cache_malloc_allocator(void *x, size_t sz) {
*((size_t*)x) = sz;