tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <cost...@covalent.net>
Subject Jk2: pools and memory
Date Thu, 06 Dec 2001 00:55:55 GMT
Hi,

The current code is using some 'interesting' tricks with the jk_pools -
it does some funny buffer allocations on the stack and use the buffer
to create a pool ( which itself is allocated on the stack ).

While this may have some performance benefits, the code is extremely hard
to read, and doesn't 'map' to the new APR pool.

What I would like to do ( if nobody objects ) is to use:
 struct jk_pool {

  ...
  jk_pool_t *(*createChild)( jk_pool_t *_this, int sizeHint );
  ...
 }

The pool_open, etc will be removed - same for the buf[] based allocation.

Given that we recycle the endpoint ( and it's pool ) - I don't think we'll
loose too much. If APR is used we'll use apr pools anyway ( which don't
have support for the funny stack allocation ). For non-APR case, malloc
will be fine.

I'll also go ahead and replace all mallocs in the code to use the
pools.

However, I'm not an C expert ( or even a C programmer ) - if I'm missing
something please let me know.

Costin






--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message