Boost logo

Boost Users :

From: Stefan Strasser (sstrasser_at_[hidden])
Date: 2005-04-24 11:45:18


FBSL schrieb:
> Thanks for answering.
>
> Stefan Strasser wrote:
>
>> you're right, the BGL uses the default new operator to allocate memory
>> which then isn't collected of course.
>> so this makes it effectively impossible to use BGL with boehm GC.
>> is there a boost guideline to allocate memory only through allocators
>> which is violated here?
>> (the "new" which is causing the leak(or one of your leaks?) in your
>> code is at line 278 of graph/detail/adjacency_list.hpp in version 1.32)
>
>
>
> As a matter of facts, by modifying the snippet code and commenting out
> the add_edge() instruction, the binary no longer leaks, so the guilty
> "new" is certainly the one you point (which allocate for an edge
> property). I tried to replace it by "new (UseGC)" in order to check if
> edge properties become collectable, but unfortunately this does not
> work, binary still leaks...
>

there are other new's in BGL, is another one used in your case? I've
found the first one by simply stepping through it.

I don't know if that's appropriate in your case but there is a way to
replace the global new operator by boehm's collactable one, see homepage.
though I still think BGL and boost in general shouldn't allocate memory
without an user defined allocator, but there isn't much(read: none)
interest in this on boost developer list.

-- 
Stefan Strasser

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net