diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-05-19 04:34:11 +0000 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-19 21:13:22 +0530 |
commit | a9d0be4f1b78d9c03e9379fc5cea0ead6114c1d0 (patch) | |
tree | 723227b21d59c39c922f2fe8d3ef287d05fef4ad /libglusterfs/src/mem-pool.h | |
parent | 25dc191c51efb97ec970b137edfe4557302b7357 (diff) |
mem-pool: Restructure mem-pool behaviour
This commit changes mem-pool behaviour to return a directly usable
address by performing the required adjustment on the address
being returned.
This is different from the previous behaviour where we're trying to fit
into the requested size, the list_head*2 also. This is not efficient
enough in terms of space but hopefully works better than not having any
mem-pool at all. Besides, I am not comfortable with mem-pool meta-data
and caller-useable memory area being the same because of the potential for
mem-pool's data structure corruption.
PS:
Please do read the comments in the code for more info during review.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfs/src/mem-pool.h')
-rw-r--r-- | libglusterfs/src/mem-pool.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h index 492e868bc..627945e1f 100644 --- a/libglusterfs/src/mem-pool.h +++ b/libglusterfs/src/mem-pool.h @@ -41,6 +41,7 @@ struct mem_pool { unsigned long padded_sizeof_type; void *pool; void *pool_end; + int real_sizeof_type; }; struct mem_pool * |