httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: Memory management in 1.3.x
Date Mon, 13 Dec 1999 18:08:54 GMT

I think you are looking at the wrong code base for work like this.  I
would suggest looking at Apache 2.0.  A lot of the malloc's outside of APR
have been done away with, and most of the memory management is being done
in a platform specific manner.  Take a look at APR and Apache 2.0, and let
me know if this will work for you.  We are looking to release a beta of 
2.0 in a few months.  

Let me know if there is anything I can help you with.


On Mon, 13 Dec 1999, Tom Harrington wrote:

> I'm porting 1.3.x to an embedded OS with some rather non-Unixish (and
> non-NTish, for that matter) restrictions on memory allocation.  Despite
> the differences I think it's possible.
> What would make this a whole lot easier would be if I could eliminate
> all calls to malloc() and the like outside of src/main/alloc.c, forcing
> all memory requests to go through the memory API.  These malloc() calls
> will need to be rewritten in one way or another if this port is to 
> succeed, and it looks like the best solution is to replace them with
> calls like ap_palloc wherever possible.
> So I'd like some feedback on the wisdom of changes like the following:
> * When a malloc() appears, replace it with:
> 	pool *ptmp;
> 	ptemp = ap_make_sub_pool(NULL);
> 	foo = ap_palloc(ptmp, ....);
> * If a corresponding free() appears, replace it with
> 	ap_destroy_pool(ptmp);
> It appears that this may not work in all cases, but every little bit 
> helps.
> -- 
> Tom Harrington
> CrosStor Software, Inc.

Ryan Bloom
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	

View raw message