Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
15903c9f
Commit
15903c9f
authored
Jul 17, 2001
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memory allocation failure would cause INSIST(ctx->stats[i].gets == 0) failure.
use consistant arguement name for MEMRECORD
parent
ecd1addb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
lib/isc/mem.c
lib/isc/mem.c
+10
-7
No files found.
lib/isc/mem.c
View file @
15903c9f
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.9
7
2001/07/1
2 05:58:20 mayer
Exp $ */
/* $Id: mem.c,v 1.9
8
2001/07/1
7 10:02:46 marka
Exp $ */
#include <config.h>
...
...
@@ -182,11 +182,12 @@ struct isc_mempool {
#define ADD_TRACE(a, b, c, d, e)
#define DELETE_TRACE(a, b, c, d, e)
#else
#define ADD_TRACE(a, b, c, d, e) add_trace_entry(a, b, c, d, e)
#define ADD_TRACE(a, b, c, d, e) \
do { if (b != NULL) add_trace_entry(a, b, c, d, e); } while (0)
#define DELETE_TRACE(a, b, c, d, e) delete_trace_entry(a, b, c, d, e)
#define MEM_TRACE ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0)
#define MEM_RECORD ((ctx->debugging & ISC_MEM_DEBUGRECORD) != 0)
#define MEM_RECORD ((
m
ctx->debugging & ISC_MEM_DEBUGRECORD) != 0)
static
void
print_active
(
isc_mem_t
*
ctx
,
FILE
*
out
);
...
...
@@ -983,7 +984,8 @@ isc__mem_get(isc_mem_t *ctx, size_t size FLARG) {
#else
/* ISC_MEM_USE_INTERNAL_MALLOC */
ptr
=
mem_get
(
ctx
,
size
);
LOCK
(
&
ctx
->
lock
);
mem_getstats
(
ctx
,
size
);
if
(
ptr
)
mem_getstats
(
ctx
,
size
);
#endif
/* ISC_MEM_USE_INTERNAL_MALLOC */
ADD_TRACE
(
ctx
,
ptr
,
size
,
file
,
line
);
...
...
@@ -1047,7 +1049,7 @@ isc__mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG)
#if ISC_MEM_TRACKLINES
static
void
print_active
(
isc_mem_t
*
ctx
,
FILE
*
out
)
{
print_active
(
isc_mem_t
*
m
ctx
,
FILE
*
out
)
{
if
(
MEM_RECORD
)
{
debuglink_t
*
dl
;
unsigned
int
i
;
...
...
@@ -1056,7 +1058,7 @@ print_active(isc_mem_t *ctx, FILE *out) {
ISC_MSG_DUMPALLOC
,
"Dump of all outstanding "
"memory allocations:
\n
"
));
dl
=
ISC_LIST_HEAD
(
ctx
->
debuglist
);
dl
=
ISC_LIST_HEAD
(
m
ctx
->
debuglist
);
if
(
dl
==
NULL
)
fprintf
(
out
,
isc_msgcat_get
(
isc_msgcat
,
ISC_MSGSET_MEM
,
ISC_MSG_NONE
,
...
...
@@ -1187,7 +1189,8 @@ isc__mem_allocate(isc_mem_t *ctx, size_t size FLARG) {
#else
/* ISC_MEM_USE_INTERNAL_MALLOC */
si
=
isc__mem_allocateunlocked
(
ctx
,
size
);
LOCK
(
&
ctx
->
lock
);
mem_getstats
(
ctx
,
si
[
-
1
].
u
.
size
);
if
(
si
!=
NULL
)
mem_getstats
(
ctx
,
si
[
-
1
].
u
.
size
);
#endif
/* ISC_MEM_USE_INTERNAL_MALLOC */
#if ISC_MEM_TRACKLINES
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment