1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* Copyright by the Board of Trustees of the University of Illinois. *
3
* All rights reserved. *
5
* This file is part of HDF5. The full HDF5 copyright notice, including *
6
* terms governing use, modification, and redistribution, is contained in *
7
* the files COPYING and Copyright.html. COPYING can be found at the root *
8
* of the source code distribution tree; Copyright.html can be found at the *
9
* root level of an installed copy of the electronic HDF5 document set and *
10
* is linked from the top-level documents page. It can also be found at *
11
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
12
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
13
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
17
* Wednesday, July 9, 2003
19
* Purpose: This file contains declarations which are visible
20
* only within the H5HG package. Source files outside the
21
* H5HG package should include H5HGprivate.h instead.
24
#error "Do not include this file outside the H5HG package!"
30
/* Get package's private header */
31
#include "H5HGprivate.h"
33
/* Other private headers needed by this file */
35
/*****************************/
36
/* Package Private Variables */
37
/*****************************/
39
/* The cache subclass */
40
H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1];
42
/**************************/
43
/* Package Private Macros */
44
/**************************/
47
* Pad all global heap messages to a multiple of eight bytes so we can load
48
* the entire collection into memory and operate on it there. Eight should
49
* be sufficient for machines that have alignment constraints because our
50
* largest data type is eight bytes.
52
#define H5HG_ALIGNMENT 8
53
#define H5HG_ALIGN(X) (H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/ \
55
#define H5HG_ISALIGNED(X) ((X)==H5HG_ALIGN(X))
58
* The overhead associated with each object in the heap, always a multiple of
59
* the alignment so that the stuff that follows the header is aligned.
61
#define H5HG_SIZEOF_OBJHDR(f) \
62
H5HG_ALIGN(2 + /*object id number */ \
63
2 + /*reference count */ \
65
H5F_SIZEOF_SIZE(f)) /*object data size */
67
/****************************/
68
/* Package Private Typedefs */
69
/****************************/
71
typedef struct H5HG_obj_t {
72
int nrefs; /*reference count */
73
size_t size; /*total size of object */
74
uint8_t *begin; /*ptr to object into heap->chunk*/
78
H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
79
/* first field in structure */
80
haddr_t addr; /*collection address */
81
size_t size; /*total size of collection */
82
uint8_t *chunk; /*the collection, incl. header */
83
size_t nalloc; /*numb object slots allocated */
84
size_t nused; /*number of slots used */
85
/* If this value is >65535 then all indices */
86
/* have been used at some time and the */
87
/* correct new index should be searched for */
88
H5HG_obj_t *obj; /*array of object descriptions */
91
/******************************/
92
/* Package Private Prototypes */
93
/******************************/