3 Definitions for the object management API protocol memory allocation... */
6 * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 1996-2003 by Internet Software Consortium
9 * This Source Code Form is subject to the terms of the Mozilla Public
10 * License, v. 2.0. If a copy of the MPL was not distributed with this
11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Internet Systems Consortium, Inc.
23 * Newmarket, NH 03857 USA
25 * https://www.isc.org/
29 isc_result_t
omapi_buffer_new (omapi_buffer_t
**, const char *, int);
30 isc_result_t
omapi_buffer_reference (omapi_buffer_t
**,
31 omapi_buffer_t
*, const char *, int);
32 isc_result_t
omapi_buffer_dereference (omapi_buffer_t
**, const char *, int);
34 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
35 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
36 #define DMDOFFSET (sizeof (struct dmalloc_preamble))
39 #define DMDSIZE (DMDOFFSET + DMLFSIZE + DMUFSIZE)
41 struct dmalloc_preamble
{
42 struct dmalloc_preamble
*prev
, *next
;
46 unsigned long generation
;
47 unsigned char low_fence
[DMLFSIZE
];
54 /* rc_history flags... */
58 #if defined (DEBUG_RC_HISTORY)
59 #if !defined (RC_HISTORY_MAX)
60 # define RC_HISTORY_MAX 256
63 #if !defined (RC_HISTORY_FLAGS)
64 # define RC_HISTORY_FLAGS (RC_LEASE | RC_MISC)
67 struct rc_history_entry
{
75 #define rc_register(x, l, r, y, z, d, f) do { \
76 if (RC_HISTORY_FLAGS & ~(f)) { \
77 rc_history [rc_history_index].file = (x); \
78 rc_history [rc_history_index].line = (l); \
79 rc_history [rc_history_index].reference = (r); \
80 rc_history [rc_history_index].addr = (y); \
81 rc_history [rc_history_index].refcnt = (z); \
82 rc_history_next (d); \
85 #define rc_register_mdl(r, y, z, d, f) \
86 rc_register (__FILE__, __LINE__, r, y, z, d, f)
88 #define rc_register(file, line, reference, addr, refcnt, d, f)
89 #define rc_register_mdl(reference, addr, refcnt, d, f)
92 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
93 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
94 extern struct dmalloc_preamble
*dmalloc_list
;
95 extern unsigned long dmalloc_outstanding
;
96 extern unsigned long dmalloc_longterm
;
97 extern unsigned long dmalloc_generation
;
98 extern unsigned long dmalloc_cutoff_generation
;
101 #if defined (DEBUG_RC_HISTORY)
102 extern struct rc_history_entry rc_history
[RC_HISTORY_MAX
];
103 extern int rc_history_index
;
104 extern int rc_history_count
;