Re: Chunked mempools, a first verdict

From: Robert Collins <robert.collins@dont-contact.us>
Date: Fri, 4 May 2001 07:25:25 +1000

>----- Original Message -----
>From: "Andres Kroonmaa" <andre@online.ee>
>To: "Alex Rousskov" <rousskov@measurement-factory.com>
>Cc: <squid-dev@squid-cache.org>
>Sent: Friday, May 04, 2001 1:39 AM
>Subject: Re: Chunked mempools, a first verdict
>

>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.

It's not just 'danger' thats an issue. If you have two calls, and NULL
is not valid, you can spit out debug()s when a attempted clean(NULL) is
made. That will help with debugging.

>> 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?

Perhaps add squid_curtime as an exprted variable from misclib, and move
the time routines into a lib. time access is a common thing after all.

Rob
Received on Thu May 03 2001 - 15:28:17 MDT

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