[geos-devel] An Immodest Proposal

Frank Warmerdam warmerdam at pobox.com
Tue Sep 30 01:26:03 EDT 2008


On Tue, Sep 30, 2008 at 6:05 AM, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> It turns out it is a quite small modification, and works pretty well:
...
>  printf("initgeos\n");
>  initGEOSMemory(malloc, free);
...
> So, something in C++ is doing a couple allocations before we can slip
> in and get our other function in place. But we can get all the big
> stuff caught no problem.

Paul,

Your approach looks fine to me.  In particular i'm pleased to see
the function to install the custom allocator is not part of the regular
init function and so does not change the old api or abi in an
incompatible way.

The initialization time allocations are a bit unfortunate.  In
fact for reasons like this and others I hate having objects
with dynamic components created during the program
startup (dll loading) process.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


More information about the geos-devel mailing list