Re: Chunked mempools, a first verdict

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 3 May 2001 17:39:24 +0200

On 3 May 2001, at 8:51, Alex Rousskov <rousskov@measurement-factory.com> wrote:

> On Thu, 3 May 2001, Andres Kroonmaa wrote:
>
> > thats how it is done. memPoolClean(MemPool * NULL) does full cleanup.
>
> IMHO, it is a dangerous practice to rely on NULL pointers to change
> the behavior of a function because the pool pointer you feed somewhere
> deep in the source code may end up being NULL for many reasons out of
> your control. I would say that having two functions:
> memPoolClean(MemPool*)
> memPoolCleanAll()
> is a better interface than one
> memPoolClean(MemPool *pool = NULL);

 Generally, probably yes. In this case, feeding NULL pointer in error
 is not dangerous.

> Then, again, I am not a strong believer in reducing the number of
> exported names at the expense of the design...

 I can live with either approach. Just gotta settle down and proceed.

 There are 2 more issues to resolve: mempool lib is rudely importing
 time_t squid_curtime to get HWmarks updated with time and to keep
 track of chunk last reference time. Ideas welcome how to stop that.
 Drop HWmark times altogether?

 Another issue is added by myself. To get rate/sec for each pool
 allocations I'm saving alloc counter each time memReport is called.
 Saving it to MemPoolMeter struct itself, ie. into library's space.
 By all means this is dirty, but then again, it was quick ;)
 I personally find it useful to see in the cachemgr output what types
 of pools get most memory traffic. It returns allocs/sec since last
 memReport output. Your opinions?

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu May 03 2001 - 09:44:02 MDT

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