Re: [bug] MemBuf and using as string

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Tue, 16 Apr 2002 11:40:09 +0300

On 16 Apr 2002, at 9:28, Henrik Nordstrom <hno@squid-cache.org> wrote:

> Andres Kroonmaa wrote:
> >
> > I think we should define a way to avoid clearing, its especially
> > notable with larger buffers. One thing that comes to mind
> > mind is defining memPoolCalloc and/or memPoolMalloc in addition
> > to memPoolAlloc, and make gradual transition. Opinions?
>
> As I'd like to have the reused pool members cleared on free for safety
> reasons (easier to spot reuse-after-free that way) I think the option
> has to be part of the pool specification, i.e. there is two kinds of
> pools
>
> a) Standard pools, where objects are guaranteed cleared
>
> b) Optimized pools, where it is not guaranteed to be cleared. Primarily
> useful for pure data buffers.
>
> It is mainly the MEM_xK_BUF pools we can optimize in this manner.

 /* Tune API */
 extern void memPoolSetChunkSize(MemPool * pool, size_t chunksize);
+extern void memPoolSetNotCleared(MemPool * pool);

 something like that?

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Tue Apr 16 2002 - 02:47:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:10 MST