diff options
author | Akira TAGOH <akira@tagoh.org> | 2006-05-24 17:34:27 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2006-05-24 17:34:27 +0000 |
commit | a62e012e7a1561c4978d34043049c546e06cd9d4 (patch) | |
tree | c37bd08dcfd7352c3785f706e5c4d0c164e3906f | |
parent | da4a5979461946554d167fd6aa27f9817cbcdff3 (diff) |
" * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_resize):
update a block size in HgMemObject as well.
(_hg_allocator_bfit_snapshot_real_to_string): implemented."
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | hieroglyph/hgallocator-bfit.c | 16 | ||||
-rw-r--r-- | hieroglyph/version.h.in | 2 |
3 files changed, 19 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2006-05-25 Akira TAGOH <at@gclab.org> + * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_resize): + update a block size in HgMemObject as well. + (_hg_allocator_bfit_snapshot_real_to_string): implemented. + * hieroglyph/hgfile.c (hg_file_object_new): fixed a memory corruption. 2006-05-19 Akira TAGOH <at@gclab.org> diff --git a/hieroglyph/hgallocator-bfit.c b/hieroglyph/hgallocator-bfit.c index 8d263ae..a3d0d82 100644 --- a/hieroglyph/hgallocator-bfit.c +++ b/hieroglyph/hgallocator-bfit.c @@ -31,6 +31,7 @@ #include "hgallocator-private.h" #include "hgmem.h" #include "hgbtree.h" +#include "hgstring.h" #define BTREE_N_NODE 6 @@ -44,6 +45,7 @@ struct _HieroGlyphAllocatorBFitPrivate { HgBTree *free_block_tree; GPtrArray *heap2block_array; HgBTree *obj2block_tree; + gint age_of_snapshot; }; struct _HieroGlyphMemBFitBlock { @@ -400,6 +402,7 @@ _hg_allocator_bfit_real_initialize(HgMemPool *pool, priv->free_block_tree = hg_btree_new(BTREE_N_NODE); priv->heap2block_array = g_ptr_array_new(); priv->obj2block_tree = hg_btree_new(BTREE_N_NODE); + priv->age_of_snapshot = 0; g_ptr_array_add(priv->heap2block_array, block); _hg_allocator_bfit_add_free_block(priv, block); @@ -605,7 +608,7 @@ _hg_allocator_bfit_real_resize(HgMemObject *object, block->next = blk->next; if (blk->next) blk->next->prev = block; - blk->length = block_size; + object->block_size = blk->length = block_size; blk->next = block; pool->used_heap_size -= block->length; _hg_allocator_bfit_add_free_block(priv, block); @@ -915,7 +918,16 @@ _hg_allocator_bfit_snapshot_real_relocate(gpointer data, static gpointer _hg_allocator_bfit_snapshot_real_to_string(gpointer data) { - return NULL; + HgMemObject *obj; + HgString *retval; + + hg_mem_get_object__inline(data, obj); + if (obj == NULL) + return NULL; + retval = hg_string_new(obj->pool, 7); + hg_string_append(retval, "-save-", -1); + + return retval; } /* diff --git a/hieroglyph/version.h.in b/hieroglyph/version.h.in index 055ddb1..1f13c18 100644 --- a/hieroglyph/version.h.in +++ b/hieroglyph/version.h.in @@ -27,7 +27,7 @@ #include <glib/gmacros.h> #define HIEROGLYPH_VERSION "@VERSION@" -#define HIEROGLYPH_UUID "d42e4fc6-ad25-4b5b-982b-e40f189fd768" +#define HIEROGLYPH_UUID "2179ec3b-5459-4a09-8455-99983a759554" const char *__hg_rcsid G_GNUC_UNUSED = "$Rev$"; |