From 31bbee784cecf4cd3f985cb6fd880148fcac3733 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Thu, 17 May 2001 19:04:09 +0000 Subject: Sync with 3.0rc7 --- omapip/message.c | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'omapip/message.c') diff --git a/omapip/message.c b/omapip/message.c index 8c0d7f4e..41c1f21f 100644 --- a/omapip/message.c +++ b/omapip/message.c @@ -54,13 +54,10 @@ isc_result_t omapi_message_new (omapi_object_t **o, const char *file, int line) omapi_object_t *g; isc_result_t status; - m = dmalloc (sizeof *m, file, line); - if (!m) - return ISC_R_NOMEMORY; - memset (m, 0, sizeof *m); - m -> type = omapi_type_message; - rc_register (file, line, &m, m, m -> refcnt); - m -> refcnt = 1; + m = (omapi_message_object_t *)0; + status = omapi_message_allocate (&m, file, line); + if (status != ISC_R_SUCCESS) + return status; g = (omapi_object_t *)0; status = omapi_generic_new (&g, file, line); @@ -84,7 +81,7 @@ isc_result_t omapi_message_new (omapi_object_t **o, const char *file, int line) } status = omapi_object_reference (o, (omapi_object_t *)m, file, line); - omapi_object_dereference ((omapi_object_t **)&m, file, line); + omapi_message_dereference (&m, file, line); omapi_object_dereference (&g, file, line); if (status != ISC_R_SUCCESS) return status; @@ -369,7 +366,36 @@ static const char *omapi_message_op_name(int op) { } #endif +static isc_result_t +omapi_message_process_internal (omapi_object_t *, omapi_object_t *); + isc_result_t omapi_message_process (omapi_object_t *mo, omapi_object_t *po) +{ + isc_result_t status; +#if defined (DEBUG_MEMORY_LEAKAGE) + unsigned long previous_outstanding = dmalloc_outstanding; +#endif + + status = omapi_message_process_internal (mo, po); + +#if defined (DEBUG_MEMORY_LEAKAGE) && 0 + log_info ("generation %ld: %ld new, %ld outstanding, %ld long-term", + dmalloc_generation, + dmalloc_outstanding - previous_outstanding, + dmalloc_outstanding, dmalloc_longterm); +#endif +#if (defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL)) && 0 + dmalloc_dump_outstanding (); +#endif +#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) && 0 + dump_rc_history (); +#endif + + return status; +} + +static isc_result_t +omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po) { omapi_message_object_t *message, *m; omapi_object_t *object = (omapi_object_t *)0; -- cgit v1.2.1