Re: How to make sure GC allocated resources stay around when used in C functions?
Kagamin via Digitalmars-d-learn Mon, 12 May 2014 12:16:31 -0700
AFAIK, addRoot is for memory allocated in GC heap, and addRange
is for other types of memory, so you can't add non-gc memory as
root (just a guess, see docs). I would allocate whole Args in GC
heap and add is as root, yes, it would prevent collection until
the root is removed. A better way would be to store Args in a
linked list in the widget, this way it will be fully managed, and
Args will live as long as the widget class instance references
them without additional tinkering with GC.
- How to make sure GC allocated reso... Gary Willoughby via Digitalmars-d-learn
- Re: How to make sure GC alloc... Kagamin via Digitalmars-d-learn
- Re: How to make sure GC a... Gary Willoughby via Digitalmars-d-learn
- Re: How to make sure ... Kagamin via Digitalmars-d-learn
- Re: How to make s... Kagamin via Digitalmars-d-learn
- Re: How to make s... Gary Willoughby via Digitalmars-d-learn
- Re: How to m... Kagamin via Digitalmars-d-learn
- Re: How ... Gary Willoughby via Digitalmars-d-learn
- Re: How to make sure GC a... Kagamin via Digitalmars-d-learn
