[geos-devel] GEOS cross-heap problems

Frank Warmerdam warmerdam at pobox.com
Wed May 13 11:29:38 EDT 2009


Sean Gillies wrote:
> 
> On May 13, 2009, at 7:42 AM, Mateusz Loskot wrote:
> 
>> Frank Warmerdam wrote:
>>> strk wrote:
>>>> On Wed, May 13, 2009 at 12:19:23AM -0400, Frank Warmerdam wrote:
>>>> Only, it'll have to stay (I've read Mateusz suggesting using
>>>> type-specific destroyers).
>>> I cannot imagine why a type specific destroyer would be needed
>>> for simple malloc()/free() buffer allocations.
>>
>> Frank,
>>
>> But GEOS user does not know what allocator is hidden behind 
>> GEOSGeomToWKT function and he does *not* need or want to know.
>>
>> GEOSFree exposes all the meat that is supposed be encapsulated
>> and it makes GEOS C API not symmetric so confusing.
> 
> Aren't we supposed to be using the reader/writer API now? Add 
> GEOSWK*Writer_Free functions (if we must) to those interfaces and 
> GEOSFree to address the problem with deprecated GeomToWKT?

Sean / Mateusz,

It is my personal opinion that since these buffers are just allocated
from the heap with malloc(), exposing a GEOS specific free - and making
it clear when it is suitable to use is a more than adequate solution.

If you guys feel strongly enough about type specific, or reader/writer
interface specific deallocators for these buffers then I'd suggest you
bring it to a motion to replace/override my implementation and I'll
then adapt GDAL appropriately.

I'm in a bad mood, and less receptive than normal to esoteric conceptual
correctness wanking.

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