summaryrefslogtreecommitdiffstats
path: root/src/H5Fistore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Fistore.c')
-rw-r--r--src/H5Fistore.c116
1 files changed, 11 insertions, 105 deletions
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 03fd598..913bdf9 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -191,9 +191,6 @@ H5B_class_t H5B_ISTORE[1] = {{
#define H5F_HASH(F,ADDR) H5F_addr_hash((ADDR/H5F_HASH_DIVISOR),(F)->shared->rdcc.nslots)
-/* Declare a free list to manage the chunk information */
-H5FL_BLK_DEFINE_STATIC(istore_chunk);
-
/* Declare a free list to manage H5F_rdcc_ent_t objects */
H5FL_DEFINE_STATIC(H5F_rdcc_ent_t);
@@ -202,97 +199,6 @@ H5FL_ARR_DEFINE_STATIC(H5F_rdcc_ent_ptr_t,-1);
/*-------------------------------------------------------------------------
- * Function: H5F_istore_chunk_alloc
- *
- * Purpose: Allocates memory for a chunk of a dataset. This routine is used
- * instead of malloc because the chunks can be kept on a free list so
- * they don't thrash malloc/free as much.
- *
- * Return: Success: valid pointer to the chunk
- *
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Tuesday, March 21, 2000
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5F_istore_chunk_alloc(size_t chunk_size)
-{
- void *ret_value; /* Pointer to the chunk to return to the user */
-
- FUNC_ENTER_NOAPI(H5F_istore_chunk_alloc, NULL);
-
- ret_value=H5FL_BLK_ALLOC(istore_chunk,chunk_size,0);
-
- FUNC_LEAVE(ret_value);
-} /* end H5F_istore_chunk_alloc() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5F_istore_chunk_free
- *
- * Purpose: Releases memory for a chunk of a dataset. This routine is used
- * instead of free because the chunks can be kept on a free list so
- * they don't thrash malloc/free as much.
- *
- * Return: Success: NULL
- *
- * Failure: never fails
- *
- * Programmer: Quincey Koziol
- * Tuesday, March 21, 2000
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5F_istore_chunk_free(void *chunk)
-{
- FUNC_ENTER_NOAPI(H5F_istore_chunk_free, NULL);
-
- H5FL_BLK_FREE(istore_chunk,chunk);
-
- FUNC_LEAVE(NULL);
-} /* end H5F_istore_chunk_free() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5F_istore_chunk_realloc
- *
- * Purpose: Resizes a chunk in chunking memory allocation system. This
- * does things the straightforward, simple way, not actually using
- * realloc.
- *
- * Return: Success: NULL
- *
- * Failure: never fails
- *
- * Programmer: Quincey Koziol
- * Tuesday, March 21, 2000
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5F_istore_chunk_realloc(void *chunk, size_t new_size)
-{
- void *ret_value=NULL; /* Return value */
-
- FUNC_ENTER_NOAPI(H5F_istore_chunk_realloc, NULL);
-
- ret_value=H5FL_BLK_REALLOC(istore_chunk,chunk,new_size);
-
- FUNC_LEAVE(ret_value);
-} /* end H5F_istore_chunk_realloc() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5F_istore_sizeof_rkey
*
* Purpose: Returns the size of a raw key for the specified UDATA. The
@@ -1016,7 +922,7 @@ H5F_istore_flush_entry(H5F_t *f, H5F_rdcc_ent_t *ent, hbool_t reset)
* for later.
*/
alloc = ent->chunk_size;
- if (NULL==(buf = H5F_istore_chunk_alloc(alloc))) {
+ if (NULL==(buf = H5MM_malloc(alloc))) {
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for pipeline");
}
@@ -1060,7 +966,7 @@ H5F_istore_flush_entry(H5F_t *f, H5F_rdcc_ent_t *ent, hbool_t reset)
ent->pline = H5O_free(H5O_PLINE, ent->pline);
if (buf==ent->chunk) buf = NULL;
if(ent->chunk!=NULL)
- ent->chunk = H5F_istore_chunk_free(ent->chunk);
+ ent->chunk = H5MM_xfree(ent->chunk);
}
ret_value = SUCCEED;
@@ -1068,7 +974,7 @@ H5F_istore_flush_entry(H5F_t *f, H5F_rdcc_ent_t *ent, hbool_t reset)
done:
/* Free the temp buffer only if it's different than the entry chunk */
if (buf!=ent->chunk)
- H5F_istore_chunk_free(buf);
+ H5MM_xfree(buf);
/*
* If we reached the point of no return then we have no choice but to
@@ -1080,7 +986,7 @@ done:
ent->layout = H5O_free(H5O_LAYOUT, ent->layout);
ent->pline = H5O_free(H5O_PLINE, ent->pline);
if(ent->chunk)
- ent->chunk = H5F_istore_chunk_free(ent->chunk);
+ ent->chunk = H5MM_xfree(ent->chunk);
}
FUNC_LEAVE(ret_value);
}
@@ -1131,7 +1037,7 @@ H5F_istore_preempt(H5F_t *f, H5F_rdcc_ent_t * ent, hbool_t flush)
ent->layout = H5O_free(H5O_LAYOUT, ent->layout);
ent->pline = H5O_free(H5O_PLINE, ent->pline);
if(ent->chunk != NULL)
- ent->chunk = H5F_istore_chunk_free(ent->chunk);
+ ent->chunk = H5MM_xfree(ent->chunk);
}
@@ -1467,7 +1373,7 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
H5_ASSIGN_OVERFLOW(chunk_size,tempchunk_size,hsize_t,size_t);
chunk_alloc = chunk_size;
- if (NULL==(chunk=H5F_istore_chunk_alloc (chunk_alloc))) {
+ if (NULL==(chunk=H5MM_malloc (chunk_alloc))) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed for raw data chunk");
}
@@ -1487,7 +1393,7 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
udata.addr = HADDR_UNDEF;
status = H5B_find (f, H5B_ISTORE, layout->addr, &udata);
H5E_clear ();
- if (NULL==(chunk = H5F_istore_chunk_alloc (chunk_alloc))) {
+ if (NULL==(chunk = H5MM_malloc (chunk_alloc))) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed for raw data chunk");
}
@@ -1645,7 +1551,7 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
done:
if (!ret_value)
- H5F_istore_chunk_free (chunk);
+ H5MM_xfree (chunk);
FUNC_LEAVE (ret_value);
}
@@ -1731,7 +1637,7 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
H5F_istore_flush_entry (f, &x, TRUE);
} else {
if(chunk)
- H5F_istore_chunk_free (chunk);
+ H5MM_xfree (chunk);
}
} else {
/*
@@ -2490,7 +2396,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Check if fill values should be written to blocks */
if(fill_time != H5D_FILL_TIME_NEVER) {
/* Allocate chunk buffer for processes to use when writing fill values */
- if (NULL==(chunk = H5F_istore_chunk_alloc(chunk_size)))
+ if (NULL==(chunk = H5MM_malloc(chunk_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for chunk");
/* Fill the chunk with the proper values */
@@ -2569,7 +2475,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
done:
/* Free the chunk for fill values */
if(chunk!=NULL)
- H5F_istore_chunk_free(chunk);
+ H5MM_xfree(chunk);
FUNC_LEAVE(ret_value);
}