Commit a6312604 authored by Rich Prohaska's avatar Rich Prohaska

delete the unused mempool compress feature

git-svn-id: file:///svn/tokudb@5439 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8bb9f478
...@@ -12,23 +12,12 @@ void toku_mempool_init(struct mempool *mp, void *base, size_t size) { ...@@ -12,23 +12,12 @@ void toku_mempool_init(struct mempool *mp, void *base, size_t size) {
mp->size = size; mp->size = size;
mp->free_offset = 0; mp->free_offset = 0;
mp->frag_size = 0; mp->frag_size = 0;
mp->compress_func = 0;
mp->compress_arg = 0;
} }
void toku_mempool_fini(struct mempool *mp __attribute__((unused))) { void toku_mempool_fini(struct mempool *mp __attribute__((unused))) {
// printf("mempool_fini %p %p %d %d\n", mp, mp->base, mp->size, mp->frag_size); // printf("mempool_fini %p %p %d %d\n", mp, mp->base, mp->size, mp->frag_size);
} }
void toku_mempool_set_compress_func(struct mempool *mp, mempool_compress_func compress_func, void *compress_arg) {
mp->compress_func = compress_func;
mp->compress_arg = compress_arg;
}
void toku_mempool_call_compress_func(struct mempool *mp) {
mp->compress_func(mp, mp->compress_arg);
}
void *toku_mempool_get_base(struct mempool *mp) { void *toku_mempool_get_base(struct mempool *mp) {
return mp->base; return mp->base;
} }
......
...@@ -12,15 +12,11 @@ ...@@ -12,15 +12,11 @@
struct mempool; struct mempool;
typedef int (*mempool_compress_func)(struct mempool *mp, void *arg);
struct mempool { struct mempool {
void *base; /* the base address of the memory */ void *base; /* the base address of the memory */
size_t free_offset; /* the offset of the memory pool free space */ size_t free_offset; /* the offset of the memory pool free space */
size_t size; /* the size of the memory */ size_t size; /* the size of the memory */
size_t frag_size; /* the size of the fragmented memory */ size_t frag_size; /* the size of the fragmented memory */
mempool_compress_func compress_func;
void *compress_arg;
}; };
/* initialize the memory pool with the base address and size of a /* initialize the memory pool with the base address and size of a
...@@ -30,10 +26,6 @@ void toku_mempool_init(struct mempool *mp, void *base, size_t size); ...@@ -30,10 +26,6 @@ void toku_mempool_init(struct mempool *mp, void *base, size_t size);
/* finalize the memory pool */ /* finalize the memory pool */
void toku_mempool_fini(struct mempool *mp); void toku_mempool_fini(struct mempool *mp);
void toku_mempool_set_compress_func(struct mempool *mp, mempool_compress_func compress_func, void *compress_arg);
void toku_mempool_call_compress_func(struct mempool *mp);
/* get the base address of the memory pool */ /* get the base address of the memory pool */
void *toku_mempool_get_base(struct mempool *mp); void *toku_mempool_get_base(struct mempool *mp);
...@@ -51,6 +43,7 @@ void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment); ...@@ -51,6 +43,7 @@ void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment);
pool does not keep track of the locations of the free chunks */ pool does not keep track of the locations of the free chunks */
void toku_mempool_mfree(struct mempool *mp, void *vp, int size); void toku_mempool_mfree(struct mempool *mp, void *vp, int size);
/* verify that a memory range is contained within a mempool */
static inline int toku_mempool_inrange(struct mempool *mp, void *vp, int size) { static inline int toku_mempool_inrange(struct mempool *mp, void *vp, int size) {
return mp->base <= vp && vp + size <= mp->base + mp->size; return mp->base <= vp && vp + size <= mp->base + mp->size;
} }
......
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