Re: [squid-users] how to use XMALLOC_TRACE and XMALLOC_DEBUG

From: Mihalis Tsoukalos <ekefe@dont-contact.us>
Date: Fri, 21 Mar 2003 17:41:56 +0200

So, if I want to simplify the following xfree

void
xfree(void *s)
{
#if XMALLOC_TRACE
    xmalloc_show_trace(s, -1);
#endif

#if XMALLOC_DEBUG
    if (s != NULL)
       check_free(s);
#endif
    if (s != NULL)
        free(s);
#if MEM_GEN_TRACE
    if (tracefp && s)
        fprintf(tracefp, "f:%p\n", s);
#endif
}

could I rewrite it like that?:

void xfree(void *s)
{
    if (s != NULL)
        free(s);
}

Another question is: if after free(s), is (s == NULL) true?

TIA,
Mihalis.

----- Original Message -----
From: "Henrik Nordstrom" <hno@squid-cache.org>
To: "Mihalis Tsoukalos" <ekefe@freemail.gr>
Cc: <squid-users@squid-cache.org>
Sent: Friday, March 21, 2003 4:42 PM
Subject: Re: [squid-users] how to use XMALLOC_TRACE and XMALLOC_DEBUG

> fre 2003-03-21 klockan 14.50 skrev Mihalis Tsoukalos:
> > Dear list,
> >
> > I want to know how to use the XMALLOC_TRACE and XMALLOC_DEBUG features.
That
> > is, how to compile squid with those features.
> > I would also like to know where (in which file) do I get the output.
>
> Why would you want to use these?
>
> See configure --help, but be warned that these are depreciated test
> functions in the Squid source, and most likely will crash your Squid.
>
> --
> Henrik Nordstrom <hno@squid-cache.org>
> MARA Systems AB, Sweden
Received on Fri Mar 21 2003 - 08:42:08 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:14:18 MST