summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-04-04 21:00:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-04-04 21:00:31 (GMT)
commit02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4 (patch)
tree4b36327c0da85d62ea116da32d0f114700d0f6c9 /src/H5Oattr.c
parent7170bbbc96f2b29f42be53f8271fc359f617e09c (diff)
downloadhdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.zip
hdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.tar.gz
hdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.tar.bz2
[svn-r2073] Added free-list code to the library and took out the older "temporary buffer"
code, since the functionality was superceded. See the followup document for details on the free-list code.
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index b5a99d6..7caadbd 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -20,6 +20,7 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5private.h>
#include <H5Eprivate.h>
+#include <H5FLprivate.h> /*Free Lists */
#include <H5Gprivate.h>
#include <H5MMprivate.h>
#include <H5Oprivate.h>
@@ -46,6 +47,7 @@ const H5O_class_t H5O_ATTR[1] = {{
H5O_attr_copy, /* copy the native value */
H5O_attr_size, /* size of raw message */
H5O_attr_reset, /* reset method */
+ NULL, /* default free method */
NULL, /* get share method */
NULL, /* set share method */
H5O_attr_debug, /* debug the message */
@@ -57,6 +59,12 @@ const H5O_class_t H5O_ATTR[1] = {{
static intn interface_initialize_g = 0;
#define INTERFACE_INIT NULL
+/* Declare external the free list for H5S_t's */
+H5FL_EXTERN(H5S_t);
+
+/* Declare external the free list for H5S_simple_t's */
+H5FL_EXTERN(H5S_simple_t);
+
/*--------------------------------------------------------------------------
NAME
H5O_attr_decode
@@ -135,14 +143,14 @@ H5O_attr_decode(H5F_t *f, const uint8_t *p, H5O_shared_t UNUSED *sh)
p += H5O_ALIGN(attr->dt_size);
/* decode the attribute dataspace */
- if (NULL==(attr->ds = H5MM_calloc(sizeof(H5S_t)))) {
+ if (NULL==(attr->ds = H5FL_ALLOC(H5S_t,1))) {
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
if((simple=(H5O_SDSPACE->decode)(f,p,NULL))!=NULL) {
attr->ds->extent.type = H5S_SIMPLE;
HDmemcpy(&(attr->ds->extent.u.simple),simple, sizeof(H5S_simple_t));
- H5MM_xfree(simple);
+ H5FL_FREE(H5S_simple_t,simple);
} else {
attr->ds->extent.type = H5S_SCALAR;
}