[geos-devel] Re: GEOS, Shapely, DLLs, and memory (Mateusz Loskot)

Ragi Y. Burhum ragi at burhum.com
Thu Apr 30 14:02:51 EDT 2009


> Date: Wed, 29 Apr 2009 18:09:31 +0100
> From: Mateusz Loskot <mateusz at loskot.net>
> Subject: Re: [geos-devel] GEOS, Shapely, DLLs, and memory
> To: GEOS Development List <geos-devel at lists.osgeo.org>
> Message-ID: <49F889CB.9070803 at loskot.net>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
>
> Ragi,
>
> AFAIU, this patch is supposed to be used against string of
> characters and byte arrays, like WKT string etc.
> These are allocated using std::malloc.
>
> Users are supposed to deallocate objects with corresponding deallocators
> like functions
>
> GEOSGeom_destroy for GEOSGeometry
> EOSCoordSeq_destroy for GEOSCoordSequence
> etc.


This shows my ignorance of the C-API :) I have been working exclusively with
the C++ ABI

>
>
> There is lack of deallocator for GEOSGeomToWKT and GEOSGeomToWKB
> and this patch, AFAIU, is supposed to cover it.
>
> Perhaps it would be better to rename GEOSFree to GEOSBufWKT_destroy
> and GEOSBufWKB_destroy, for clarity.
>

Now this name change makes sense to me. My (incorrect) assumption was that
GEOSFree was meant to destroy memory allocated from within GEOS, not that it
was meant to free memory allocated exclusively by these two functions.

Thanks for the clarification.

- Ragi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20090430/0f784b97/attachment.html


More information about the geos-devel mailing list