1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Andrew redefines the free() function to do some memory management testing.

He also suggested that some systems may implement free() as a macro (but
I think he was looking for an excuse ;).  Anyway, I've added a function
to mangle.c that calls free().
Chris -)-----
(This used to be commit 95f7b03285)
This commit is contained in:
Christopher R. Hertel 1998-05-06 19:22:45 +00:00
parent 346abceb27
commit 10a610cbc4

View File

@ -472,6 +472,24 @@ static signed int cache_compare( ubi_btItemPtr ItemPtr, ubi_btNodePtr NodePtr )
return( StrCaseCmp( Key1, Key2 ) );
} /* cache_compare */
/* ************************************************************************** **
* Free a cache entry.
*
* Input: WarrenZevon - Pointer to the entry that is to be returned to
* Nirvana.
* Output: none.
*
* Notes: This function gets around the possibility that the standard
* free() function may be implemented as a macro, or other evil
* subversions (oh, so much fun).
*
* ************************************************************************** **
*/
static void cache_free_entry( ubi_trNodePtr WarrenZevon )
{
free( WarrenZevon );
} /* cache_free_entry */
/* ************************************************************************** **
* Initializes or clears the mangled cache.
*
@ -494,7 +512,7 @@ void reset_mangled_cache( void )
{
(void)ubi_cacheInit( mangled_cache,
cache_compare,
(ubi_trKillNodeRtn)free,
cache_free_entry,
MANGLED_CACHE_MAX_ENTRIES,
MANGLED_CACHE_MAX_MEMORY );
mc_initialized = True;