diff options
author | Akira TAGOH <akira@tagoh.org> | 2006-09-03 18:16:42 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2006-09-03 18:16:42 +0000 |
commit | fe86d53f31d34426589c3af57db6611cb4539aed (patch) | |
tree | 71c8b1433442e93ea818674884f7d0f2a853daeb /src | |
parent | 0262c34c623133545a51c0a9b7cc6fa5c437f251 (diff) |
2006-09-04 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_real_set_flags): fixed outdated
function call.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize):
disable the unsuported features.
(_hg_allocator_bfit_real_garbage_collection): output more debugging
info.
* src/hgspy_helper.c (hg_mem_alloc_with_flags): fixed a segfault issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/hgspy_helper.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/hgspy_helper.c b/src/hgspy_helper.c index 6a90b14..7c64386 100644 --- a/src/hgspy_helper.c +++ b/src/hgspy_helper.c @@ -126,14 +126,18 @@ hg_mem_alloc_with_flags(HgMemPool *pool, hg_mem_get_object__inline(retval, obj); if (obj) { gint heap_id = HG_MEMOBJ_GET_HEAP_ID (obj); - HgHeap *h = g_ptr_array_index(obj->pool->heap_list, heap_id); - - hg_memory_visualizer_set_chunk_state(HG_MEMORY_VISUALIZER (visual), - hg_mem_pool_get_name(obj->pool), - heap_id, - (gsize)obj - (gsize)h->heaps, - hg_mem_get_object_size(retval), - HG_CHUNK_USED); + GPtrArray *a = obj->pool->heap_list; + HgHeap *h; + + if (a && a->len > 0) { + h = g_ptr_array_index(a, heap_id); + hg_memory_visualizer_set_chunk_state(HG_MEMORY_VISUALIZER (visual), + hg_mem_pool_get_name(obj->pool), + heap_id, + (gsize)obj - (gsize)h->heaps, + hg_mem_get_object_size(retval), + HG_CHUNK_USED); + } } } |