summaryrefslogtreecommitdiffstats
path: root/src/H5FLprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-01-17 18:08:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-01-17 18:08:00 (GMT)
commit6f445c649d559502f65082dadb06a6a39e167294 (patch)
tree612a43cedc80b75f59054e186501e0cfad80f313 /src/H5FLprivate.h
parent704f31c15174d0e313cad7b978dd7f01281bda7a (diff)
downloadhdf5-6f445c649d559502f65082dadb06a6a39e167294.zip
hdf5-6f445c649d559502f65082dadb06a6a39e167294.tar.gz
hdf5-6f445c649d559502f65082dadb06a6a39e167294.tar.bz2
[svn-r4842] Purpose:
Feature improvement Description: Re-write how the free-list headers were used, to reduce the amount of space added to each malloc request. Reduced header for array and block free list items from 24 bytes to 8 bytes and eliminated the header for fixed-size free list items entirely. This should reduce the amount of memory that the library uses. Platforms tested: FreeBSD 4.5 (sleipnir) & IRIX64 6.5 (modi4)
Diffstat (limited to 'src/H5FLprivate.h')
-rw-r--r--src/H5FLprivate.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index 1fbd599..ff89487 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -31,13 +31,6 @@
/* Data structure to store each block in free list */
typedef struct H5FL_reg_node_t {
struct H5FL_reg_node_t *next; /* Pointer to next block in free list */
-#ifdef H5FL_DEBUG
- unsigned inuse; /* Indicate when object is in use */
-#endif /* H5FL_DEBUG */
- union {
- double unused1; /* Unused normally, just here for aligment */
- haddr_t unused2; /* Unused normally, just here for aligment */
- }align; /* Bogus union, just here to align following block */
} H5FL_reg_node_t;
/* Data structure for free list of blocks */
@@ -73,14 +66,12 @@ typedef struct H5FL_reg_head_t {
* only support fixed sized types, like structs, etc..
*/
-/* Data structure to store each block in free list */
-typedef struct H5FL_blk_list_t {
+/* Data structure to store information about each block allocated */
+typedef union H5FL_blk_list_t {
size_t size; /* Size of the page */
- struct H5FL_blk_list_t *next; /* Pointer to next block in free list */
- union {
- double unused1; /* Unused normally, just here for aligment */
- haddr_t unused2; /* Unused normally, just here for aligment */
- }align; /* Bogus union, just here to align following block */
+ union H5FL_blk_list_t *next; /* Pointer to next block in free list */
+ double unused1; /* Unused normally, just here for aligment */
+ haddr_t unused2; /* Unused normally, just here for aligment */
} H5FL_blk_list_t;
/* Data structure for priority queue node of block free lists */
@@ -123,13 +114,11 @@ typedef struct H5FL_blk_head_t {
#define H5FL_BLK_REALLOC(t,blk,new_size) H5FL_blk_realloc(&(t##_pq),blk,new_size)
/* Data structure to store each array in free list */
-typedef struct H5FL_arr_node_t {
- struct H5FL_arr_node_t *next; /* Pointer to next block in free list */
+typedef union H5FL_arr_node_t {
+ union H5FL_arr_node_t *next; /* Pointer to next block in free list */
size_t nelem; /* Number of elements in this array */
- union {
- double unused1; /* Unused normally, just here for aligment */
- haddr_t unused2; /* Unused normally, just here for aligment */
- }align; /* Bogus union, just here to align following block */
+ double unused1; /* Unused normally, just here for aligment */
+ haddr_t unused2; /* Unused normally, just here for aligment */
} H5FL_arr_node_t;
/* Data structure for free list of array blocks */