3 Definitions for the object management API protocol memory allocation... */
6 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 1996-2003 by Internet Software Consortium
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
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 * Redwood City, CA 94063
27 * This software has been written for Internet Systems Consortium
28 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29 * To learn more about Internet Systems Consortium, see
30 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
31 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
32 * ``http://www.nominum.com''.
35 isc_result_t
omapi_buffer_new (omapi_buffer_t
**, const char *, int);
36 isc_result_t
omapi_buffer_reference (omapi_buffer_t
**,
37 omapi_buffer_t
*, const char *, int);
38 isc_result_t
omapi_buffer_dereference (omapi_buffer_t
**, const char *, int);
40 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
41 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
42 #define DMDOFFSET (sizeof (struct dmalloc_preamble))
45 #define DMDSIZE (DMDOFFSET + DMLFSIZE + DMUFSIZE)
47 struct dmalloc_preamble
{
48 struct dmalloc_preamble
*prev
, *next
;
52 unsigned long generation
;
53 unsigned char low_fence
[DMLFSIZE
];
60 /* rc_history flags... */
64 #if defined (DEBUG_RC_HISTORY)
65 #if !defined (RC_HISTORY_MAX)
66 # define RC_HISTORY_MAX 256
69 #if !defined (RC_HISTORY_FLAGS)
70 # define RC_HISTORY_FLAGS (RC_LEASE | RC_MISC)
73 struct rc_history_entry
{
81 #define rc_register(x, l, r, y, z, d, f) do { \
82 if (RC_HISTORY_FLAGS & ~(f)) { \
83 rc_history [rc_history_index].file = (x); \
84 rc_history [rc_history_index].line = (l); \
85 rc_history [rc_history_index].reference = (r); \
86 rc_history [rc_history_index].addr = (y); \
87 rc_history [rc_history_index].refcnt = (z); \
88 rc_history_next (d); \
91 #define rc_register_mdl(r, y, z, d, f) \
92 rc_register (__FILE__, __LINE__, r, y, z, d, f)
94 #define rc_register(file, line, reference, addr, refcnt, d, f)
95 #define rc_register_mdl(reference, addr, refcnt, d, f)
98 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
99 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
100 extern struct dmalloc_preamble
*dmalloc_list
;
101 extern unsigned long dmalloc_outstanding
;
102 extern unsigned long dmalloc_longterm
;
103 extern unsigned long dmalloc_generation
;
104 extern unsigned long dmalloc_cutoff_generation
;
107 #if defined (DEBUG_RC_HISTORY)
108 extern struct rc_history_entry rc_history
[RC_HISTORY_MAX
];
109 extern int rc_history_index
;
110 extern int rc_history_count
;