HDF5  1.12.0
H5HGprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * Programmer: Robb Matzke <matzke@llnl.gov>
16  * Friday, March 27, 1998
17  */
18 #ifndef _H5HGprivate_H
19 #define _H5HGprivate_H
20 
21 /* Private headers needed by this file. */
22 #include "H5Fprivate.h" /* File access */
23 
24 /* Information to locate object in global heap */
25 typedef struct H5HG_t {
26  haddr_t addr; /*address of collection */
27  size_t idx; /*object ID within collection */
29 
30 /* Typedef for heap in memory (defined in H5HGpkg.h) */
31 typedef struct H5HG_heap_t H5HG_heap_t;
32 
33 
34 /*
35  * Limit global heap collections to the some reasonable size. This is
36  * fairly arbitrary, but needs to be small enough that no more than H5HG_MAXIDX
37  * objects will be allocated from a single heap.
38  */
39 #define H5HG_MAXSIZE 65536
40 
41 /* If the module using this macro is allowed access to the private variables, access them directly */
42 #ifdef H5HG_MODULE
43 #define H5HG_ADDR(H) ((H)->addr)
44 #define H5HG_SIZE(H) ((H)->size)
45 #define H5HG_FREE_SIZE(H) ((H)->obj[0].size)
46 #else /* H5HG_MODULE */
47 #define H5HG_ADDR(H) (H5HG_get_addr(H))
48 #define H5HG_SIZE(H) (H5HG_get_size(H))
49 #define H5HG_FREE_SIZE(H) (H5HG_get_free_size(H))
50 #endif /* H5HG_MODULE */
51 
52 /* Size of encoded global heap ID */
53 /* (size of file address + 32-bit integer) */
54 #define H5HG_HEAP_ID_SIZE(F) ((size_t)H5F_SIZEOF_ADDR(F) + H5_SIZEOF_UINT32_T)
55 
56 
57 /* Main global heap routines */
58 H5_DLL herr_t H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj/*out*/);
59 H5_DLL void *H5HG_read(H5F_t *f, H5HG_t *hobj, void *object, size_t *buf_size/*out*/);
60 H5_DLL int H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust);
61 H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size);
63 
64 /* Support routines */
65 H5_DLL herr_t H5HG_extend(H5F_t *f, haddr_t addr, size_t need);
66 
67 /* Query routines */
69 H5_DLL size_t H5HG_get_size(const H5HG_heap_t *h);
70 H5_DLL size_t H5HG_get_free_size(const H5HG_heap_t *h);
71 
72 /* Debugging functions */
74  int fwidth);
75 
76 #endif /* _H5HGprivate_H */
77 
H5HG_read
H5_DLL void * H5HG_read(H5F_t *f, H5HG_t *hobj, void *object, size_t *buf_size)
Definition: H5HG.c:595
size
iblock size
Definition: H5EAcache.c:787
f
hdr f
Definition: H5EA.c:755
H5HG_remove
H5_DLL herr_t H5HG_remove(H5F_t *f, H5HG_t *hobj)
Definition: H5HG.c:766
H5HG_debug
H5_DLL herr_t H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth)
Definition: H5HGdbg.c:86
H5HG_heap_t::obj
H5HG_obj_t * obj
Definition: H5HGpkg.h:134
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5HG_get_size
H5_DLL size_t H5HG_get_size(const H5HG_heap_t *h)
Definition: H5HGquery.c:110
H5HG_heap_t::addr
haddr_t addr
Definition: H5HGpkg.h:125
indent
*s *s indent
Definition: H5HLdbg.c:111
H5HG_get_free_size
H5_DLL size_t H5HG_get_free_size(const H5HG_heap_t *h)
Definition: H5HGquery.c:134
H5HG_get_obj_size
H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size)
Definition: H5HG.c:723
H5HG_get_addr
H5_DLL haddr_t H5HG_get_addr(const H5HG_heap_t *h)
Definition: H5HGquery.c:86
H5HG_insert
H5_DLL herr_t H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj)
Definition: H5HG.c:508
H5HG_link
H5_DLL int H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust)
Definition: H5HG.c:669
H5HG_heap_t
Definition: H5HGpkg.h:122
FILE
Invalid arguments to routine Resource unavailable Internal File accessibility Low level I O Function entry exit Object atom Object cache Links B Tree node Symbol table Heap Object header Datatype Dataspace Dataset Data storage Property lists Attribute Data filters External file list References Virtual File Layer Virtual Object Layer Ternary Search Trees Reference Counted Strings Error API Skip Lists Free Space Manager Shared Object Header Messages Extensible Array Fixed Array Plugin for dynamically loaded library Page Buffering API Context Map No error Argument errors Resource errors File accessibility errors FILE
Definition: H5err.txt:88
H5Fprivate.h
fwidth
*s *s fwidth
Definition: H5HLdbg.c:111
H5HG_t::addr
haddr_t addr
Definition: H5HGprivate.h:26
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5F_t
Definition: H5Fpkg.h:374
herr_t
int herr_t
Definition: H5public.h:128
H5HG_t::idx
size_t idx
Definition: H5HGprivate.h:27
H5HG_t
Definition: H5HGprivate.h:25
H5HG_t
struct H5HG_t H5HG_t
H5HG_extend
H5_DLL herr_t H5HG_extend(H5F_t *f, haddr_t addr, size_t need)
Definition: H5HG.c:418