Re: [bug] MemBuf and using as string

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 16 Apr 2002 09:28:57 +0200

Andres Kroonmaa wrote:
>
> Yeah, my fault, should have mentioned that after a commit.
> It was test optimisation that I found to be stable enough
> that I left it in on our production boxes. I was seeing the
> issue you mentioned but never thought it was caused by me ;)
>
> 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.

Regards
Henrik
Received on Tue Apr 16 2002 - 01:55:20 MDT

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