mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r18039] Description:
Minor code cleanups, to align better w/ongoing metadata journaling convergence. Tested on: Mac OS X/32 10.6.2 (amazon) w/debug (too minor to require h5committest)
This commit is contained in:
parent
ac446b6131
commit
e66ae8b671
19
src/H5HG.c
19
src/H5HG.c
@ -99,6 +99,15 @@ static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size);
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
|
||||
/* Declare a free list to manage the H5HG_t struct */
|
||||
H5FL_DEFINE(H5HG_heap_t);
|
||||
|
||||
/* Declare a free list to manage sequences of H5HG_obj_t's */
|
||||
H5FL_SEQ_DEFINE(H5HG_obj_t);
|
||||
|
||||
/* Declare a PQ free list to manage heap chunks */
|
||||
H5FL_BLK_DEFINE(gheap_chunk);
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
@ -109,15 +118,6 @@ static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size);
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* Declare a free list to manage the H5HG_t struct */
|
||||
H5FL_DEFINE(H5HG_heap_t);
|
||||
|
||||
/* Declare a free list to manage sequences of H5HG_obj_t's */
|
||||
H5FL_SEQ_DEFINE(H5HG_obj_t);
|
||||
|
||||
/* Declare a PQ free list to manage heap chunks */
|
||||
H5FL_BLK_DEFINE(gheap_chunk);
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -829,7 +829,6 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj)
|
||||
* The collection is empty. Remove it from the CWFS list and return it
|
||||
* to the file free list.
|
||||
*/
|
||||
H5_CHECK_OVERFLOW(heap->size, size_t, hsize_t);
|
||||
flags |= H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; /* Indicate that the object was deleted, for the unprotect call */
|
||||
} /* end if */
|
||||
else {
|
||||
|
@ -75,16 +75,6 @@ static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_pt
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
/*****************************/
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* H5HG inherits cache-like properties from H5AC */
|
||||
const H5AC_class_t H5AC_GHEAP[1] = {{
|
||||
H5AC_GHEAP_ID,
|
||||
@ -97,6 +87,16 @@ const H5AC_class_t H5AC_GHEAP[1] = {{
|
||||
}};
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
/*****************************/
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5HG_load
|
||||
@ -381,7 +381,7 @@ H5HG_dest(H5F_t *f, H5HG_heap_t *heap)
|
||||
heap->chunk = H5FL_BLK_FREE(gheap_chunk, heap->chunk);
|
||||
if(heap->obj)
|
||||
heap->obj = H5FL_SEQ_FREE(H5HG_obj_t, heap->obj);
|
||||
(void)H5FL_FREE(H5HG_heap_t, heap);
|
||||
heap = H5FL_FREE(H5HG_heap_t, heap);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
22
src/H5HL.c
22
src/H5HL.c
@ -72,6 +72,15 @@ static herr_t H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap);
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
|
||||
/* Declare a free list to manage the H5HL_free_t struct */
|
||||
H5FL_DEFINE(H5HL_free_t);
|
||||
|
||||
/* Declare a free list to manage the H5HL_t struct */
|
||||
H5FL_DEFINE(H5HL_t);
|
||||
|
||||
/* Declare a PQ free list to manage the heap chunk information */
|
||||
H5FL_BLK_DEFINE(lheap_chunk);
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
@ -82,15 +91,6 @@ static herr_t H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap);
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* Declare a free list to manage the H5HL_free_t struct */
|
||||
H5FL_DEFINE(H5HL_free_t);
|
||||
|
||||
/* Declare a free list to manage the H5HL_t struct */
|
||||
H5FL_DEFINE(H5HL_t);
|
||||
|
||||
/* Declare a PQ free list to manage the heap chunk information */
|
||||
H5FL_BLK_DEFINE(lheap_chunk);
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -359,7 +359,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw)
|
||||
HDassert(H5F_addr_defined(addr));
|
||||
|
||||
if(NULL == (ret_value = (H5HL_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP, addr, NULL, NULL, rw)))
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load heap")
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -891,7 +891,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)
|
||||
|
||||
/* Get heap pointer */
|
||||
if(NULL == (heap = (H5HL_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP, addr, NULL, NULL, H5AC_READ)))
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap")
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap")
|
||||
|
||||
/* Set the size to return */
|
||||
*size = heap->heap_alloc;
|
||||
|
@ -76,16 +76,6 @@ static herr_t H5HL_clear(H5F_t *f, H5HL_t *heap, hbool_t destroy);
|
||||
/* Package Variables */
|
||||
/*********************/
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
/*****************************/
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* H5HL inherits cache-like properties from H5AC */
|
||||
const H5AC_class_t H5AC_LHEAP[1] = {{
|
||||
H5AC_LHEAP_ID,
|
||||
@ -97,6 +87,17 @@ const H5AC_class_t H5AC_LHEAP[1] = {{
|
||||
(H5AC_size_func_t)H5HL_size,
|
||||
}};
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Library Private Variables */
|
||||
/*****************************/
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5HL_serialize
|
||||
@ -404,9 +405,9 @@ H5HL_dest(H5F_t *f, H5HL_t *heap)
|
||||
while(heap->freelist) {
|
||||
fl = heap->freelist;
|
||||
heap->freelist = fl->next;
|
||||
(void)H5FL_FREE(H5HL_free_t, fl);
|
||||
fl = H5FL_FREE(H5HL_free_t, fl);
|
||||
} /* end while */
|
||||
(void)H5FL_FREE(H5HL_t, heap);
|
||||
heap = H5FL_FREE(H5HL_t, heap);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
Loading…
Reference in New Issue
Block a user