]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
C++ convert the global C functions that operate on class CacheDigest
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 18 Nov 2015 13:28:57 +0000 (05:28 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 18 Nov 2015 13:28:57 +0000 (05:28 -0800)
This is largely a symbol renaming change. But there are two relatively
small logic changes:

1) convert the class to MEMPROXY_CLASS.

Which alters the pool creation timing from general memory pool
initialization time, to whenever the CacheDigest object is first used.

A nice side effect is removal the macro conditional within the old pool
type enumeration. Macros like that in enumeration lists such as this one
have been causing some builds to have run-time errors accessing memory
arrays out-of-bounds or incorrect postions when the build-time
dependency detection issues caused build objects to link with different
./configure'd versions.

2) Constructor logic sequence alteration.

The old *Create function used to set some members then call the *Init
function which would re-set some of them, and initialize most of the
rest (but not all).
The old *UpdateCap function would call a helper that emulated
safe_free(mask) then *Init to alter the objects mask related members
whether they needed it or not.

The class constructor now initializes all members via initialization
list then calls updateCapacity(), which calls a simplified init(). This
altered sequence contains the same operational acts while the new order
avoids repeated or unnecesarily setting members on create and update.


Trivial merge