c,cpp: optimize msgpack_zone: variable-length array of chunk -> list of chunk

This commit is contained in:
frsyuki 2010-01-15 05:27:44 +09:00
parent 55cfbf378e
commit 8d365458d5
5 changed files with 88 additions and 109 deletions

View file

@ -32,7 +32,7 @@ nobase_include_HEADERS = \
libmsgpack_la_LIBADD = -L../c -lmsgpackc
# -version-info CURRENT:REVISION:AGE
libmsgpack_la_LDFLAGS = -version-info 1:0:0
libmsgpack_la_LDFLAGS = -version-info 2:0:0
check_PROGRAMS = \
msgpack_test

View file

@ -120,9 +120,8 @@ void zone::object_destructor(void* obj)
inline void zone::undo_malloc(size_t size)
{
msgpack_zone_chunk* chunk = base::chunk_array.tail;
chunk->ptr -= size;
chunk->free += size;
base::chunk_list.ptr -= size;
base::chunk_list.free += size;
}
<%0.upto(GENERATION_LIMIT) {|i|%>