diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-06 13:11:45 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-06 13:11:45 (GMT) |
commit | 43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8 (patch) | |
tree | a965cb03f135b474e8f303bc72ba2a17de8209d0 /src/H5Gnode.c | |
parent | 4c8f0b2463410eff8a0a6c4531ad051d7c33abd1 (diff) | |
download | hdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.zip hdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.tar.gz hdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.tar.bz2 |
[svn-r8301] Purpose:
Code optimization
Description:
Move handling for free list arrays that have no maximum size to separate
set of routines and optimize computations for free list arrays with maximum
size to avoid re-computing sizes all the time.
Platforms tested:
h5committest
Solaris 2.7 (arabica)
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index e188cdd..8c7dc74 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -134,8 +134,8 @@ static int interface_initialize_g = 0; /* Declare a free list to manage the H5G_node_t struct */ H5FL_DEFINE_STATIC(H5G_node_t); -/* Declare a free list to manage arrays of H5G_entry_t's */ -H5FL_ARR_DEFINE_STATIC(H5G_entry_t,-1); +/* Declare a free list to manage sequences of H5G_entry_t's */ +H5FL_SEQ_DEFINE_STATIC(H5G_entry_t); /* Declare a free list to manage blocks of symbol node data */ H5FL_BLK_DEFINE_STATIC(symbol_node); @@ -360,7 +360,7 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_udata1 HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for symbol table node"); p=buf; if (NULL==(sym = H5FL_CALLOC(H5G_node_t)) || - NULL==(sym->entry=H5FL_ARR_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))))) + NULL==(sym->entry=H5FL_SEQ_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node"); @@ -572,7 +572,7 @@ H5G_node_dest(H5F_t UNUSED *f, H5G_node_t *sym) assert (sym->cache_info.dirty==0); if(sym->entry) - sym->entry = H5FL_ARR_FREE(H5G_entry_t,sym->entry); + sym->entry = H5FL_SEQ_FREE(H5G_entry_t,sym->entry); H5FL_FREE(H5G_node_t,sym); FUNC_LEAVE_NOAPI(SUCCEED); @@ -671,7 +671,7 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, size))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space"); sym->cache_info.dirty = TRUE; - sym->entry = H5FL_ARR_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))); + sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))); if (NULL==sym->entry) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); if (H5AC_set(f, dxpl_id, H5AC_SNODE, *addr_p, sym) < 0) @@ -691,7 +691,7 @@ done: if(ret_value<0) { if(sym!=NULL) { if(sym->entry!=NULL) - H5FL_ARR_FREE(H5G_entry_t,sym->entry); + H5FL_SEQ_FREE(H5G_entry_t,sym->entry); H5FL_FREE(H5G_node_t,sym); } /* end if */ } /* end if */ |