httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: Purify vs Apache
Date Mon, 06 Oct 1997 18:36:24 GMT
We talked about it recently.  To get good data you would have to put
support into alloc.c.  Right now we do our own memory allocation and only
get 8k chunks from malloc.  What you'd want to do is something like this: 

/* add void *mem_chunks; to the pool structure */

/* we use CLICK_SZ to preserve alignment while allocating enough room to
 * stuff a void * in front of every allocation
 */

void *palloc(pool *p, size_t s)
{
    void *b;

    b = malloc(s + CLICK_SZ);
    *(void **)b = p->mem_chunks;
    p->mem_chunks = b;
    return (void *)((char *)b + CLICK_SZ);
}

/* and then in clear_pool do something like this to free up that memory */

{
    void *cur;
    void *next;

    for (cur = p->mem_chunks; cur; cur = next) {
	next = *(void **)cur;
	free(cur);
    }
}

I don't have access to Purify... although maybe they want to donate a Linux or
FreeBSD copy to Apache.

Dean

On Mon, 6 Oct 1997, Charles Randall wrote:

> Has anyone examined Apache with Purify?
> 
> Charles F. Randall
> crandall@matchlogic.com
> MatchLogic, Inc.
> 
> 
> 


Mime
View raw message