[geos-devel] Unclear objects lifetime and ownership issues in Monotone Chain components

Mateusz Loskot mateusz at loskot.net
Wed Sep 24 10:56:29 EDT 2008


strk wrote:
> On Wed, Sep 24, 2008 at 02:10:51PM +0200, Mateusz Loskot wrote:
>
>> Here is longer story [2] with suggested solution, however I'm not enough
>> knowledgeable about all internals especially about possible relations
>> between various collections allocated internally as well as flows and
>> ownership transfers.
>>
>> I'd be thankful if original authors of these components (Ben?, Sandro?)
>> could share their minds.
>
> Truth is (and you know): GEOS needs a GC !
> Can't keep being considered 1:1 mapping with JTS if doesn't have one...


Sandro,

Any particular GC technique you have in mind?

IMHO, one of possible and clean solution for this kind of issues in GEOS
is to apply GC in form of shared_ptr - smart pointer that controls
lifetime of objects and frees developers from knowing *when* an object
is/should be deallocated.

However, I'm not really sure if GEOS is ready for another revolution ;-)

Ciao,
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the geos-devel mailing list