summaryrefslogtreecommitdiffstats
path: root/src/H5FLprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-02-03 19:59:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-02-03 19:59:05 (GMT)
commit0b332ace5e6a94c1238b99268675a9ba840215c0 (patch)
tree373c7c8d4533ea7273d4bfd9c4bf72a559399b5a /src/H5FLprivate.h
parent3bf1bfa4ec9988e038944b59fcaa8acc2d79f734 (diff)
downloadhdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.zip
hdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.tar.gz
hdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.tar.bz2
[svn-r9928] Purpose:
New feature Description: Add basic code for new B-tree implementation. They don't do much yet, aren't hooked up to anything yet and the format may change, but I'd like to start getting them into the daily tests. Platforms tested: FreeBSD 4.11 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'src/H5FLprivate.h')
-rw-r--r--src/H5FLprivate.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index 641a630..cc19d99 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -41,6 +41,7 @@
#define H5_NO_ARR_FREE_LISTS
#define H5_NO_SEQ_FREE_LISTS
#define H5_NO_BLK_FREE_LISTS
+#define H5_NO_FAC_FREE_LISTS
#endif /* H5_NO_FREE_LISTS */
/*
@@ -297,6 +298,35 @@ typedef struct H5FL_seq_head_t {
#define H5FL_SEQ_REALLOC(t,obj,new_elem) H5MM_realloc(obj,(new_elem)*sizeof(t))
#endif /* H5_NO_SEQ_FREE_LISTS */
+/* Data structure for free list block factory */
+typedef struct H5FL_fac_head_t {
+ H5FL_blk_head_t queue; /* Priority queue of blocks */
+ size_t size; /* Size of the blocks managed */
+} H5FL_fac_head_t;
+
+/*
+ * Macros for defining & using free list factories
+ *
+ * Factories are dynamically created free list managers for blocks of
+ * a particular size.
+ *
+ */
+#ifndef H5_NO_FAC_FREE_LISTS
+/* Allocate a block from a factory */
+#define H5FL_FAC_MALLOC(t) H5FL_fac_malloc(t)
+
+/* Allocate a block from a factory and clear it to all zeros */
+#define H5FL_FAC_CALLOC(t) H5FL_fac_calloc(t)
+
+/* Return a block to a factory */
+#define H5FL_FAC_FREE(t,obj) H5FL_fac_free(t,obj)
+
+#else /* H5_NO_FAC_FREE_LISTS */
+#define H5FL_FAC_MALLOC(t) H5MM_malloc(t->size)
+#define H5FL_FAC_CALLOC(t) H5MM_calloc(t->size)
+#define H5FL_FAC_FREE(t,obj) H5MM_xfree(obj)
+#endif /* H5_NO_FAC_FREE_LISTS */
+
/*
* Library prototypes.
*/
@@ -316,6 +346,11 @@ H5_DLL void * H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem);
H5_DLL void * H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem);
H5_DLL void * H5FL_seq_free(H5FL_seq_head_t *head, void *obj);
H5_DLL void * H5FL_seq_realloc(H5FL_seq_head_t *head, void *obj, size_t new_elem);
+H5_DLL H5FL_fac_head_t *H5FL_fac_init(size_t size);
+H5_DLL void * H5FL_fac_malloc(H5FL_fac_head_t *head);
+H5_DLL void * H5FL_fac_calloc(H5FL_fac_head_t *head);
+H5_DLL void * H5FL_fac_free(H5FL_fac_head_t *head, void *obj);
+H5_DLL herr_t H5FL_fac_term(H5FL_fac_head_t *head);
H5_DLL herr_t H5FL_garbage_coll(void);
H5_DLL herr_t H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim,
int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);