Paul,
It turns out it is a quite small modification, and works pretty well:http://trac.osgeo.org/geos/attachment/ticket/208/memdiff.patch My patch adds the ability to override, and also has some printfs to show what is happening. When the overridden allocator is called without the runtime callback set, it prints "std alloc" and when it's called with the callback set, it prints "geos alloc".
If you're going to run into any problems it will be on Windows, since its so fussy about memory being allocated/deallocated from the same runtime library's heap. Looks like your solution does that. But I wonder if there will be issues accessing the postgresql allocated memory from GEOS - like what happens if you call sizeof and such? My guess it works, but would be good to run a debug build of geos/postgis - built with VC++2005 or 2008 since it adds various assertions to check these sorts of things.
Charlie
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel