futriix/src/storage.h
John Sully 7f560f8e65 EMBSTR size is lower than it needs to be
Former-commit-id: fab6132cb3a0594f6ef65163fcb6f1e0ff8d7587
2020-04-24 22:19:55 -04:00

34 lines
747 B
C

#ifndef __STORAGE_H__
#define __STORAGE_H__
#define OBJ_ENCODING_EMBSTR_SIZE_LIMIT 48 // Note: also defined in object.c - should always match
#ifdef __cplusplus
extern "C" {
#endif
enum MALLOC_CLASS
{
MALLOC_LOCAL,
MALLOC_SHARED,
};
void storage_init(const char *tmpfilePath, size_t cbFileReserve);
void *salloc(size_t cb, enum MALLOC_CLASS mclass);
void *scalloc(size_t cb, size_t c, enum MALLOC_CLASS mclass);
void sfree(void*);
void *srealloc(void *pv, size_t cb, enum MALLOC_CLASS mclass);
size_t salloc_usable_size(void *ptr);
struct redisObject *salloc_objembstr();
void sfree_objembstr(struct redisObject *obj);
struct redisObject *salloc_obj();
void sfree_obj(struct redisObject *obj);
#ifdef __cplusplus
}
#endif
#endif