[Gc] Silently fails to allocate memory?

Bruce Hoult bruce at hoult.org
Sat Apr 13 10:05:23 PDT 2013

On Sun, Apr 14, 2013 at 4:35 AM, The Devils Jester <
thedevilsjester at gmail.com> wrote:

>> Of course, if those pointers were to memory allocated by GC and there are
>> no other live pointers to those objects. And if the memory for the vector
>> itself has been allocated by GC.
> I might not be understanding this correctly.  Additional comments say that
> memory for my objects in a vector are created using malloc, but I
> explicitly use the new operator, for example:
> vector<myclass*> a;
> myclass* b = new myclass();
> a.push_back(b);
> If myclass inherits from gc, and I use the new operator (that has been
> overloaded by libgc) what would be the issue here?  Am I missing something?

b is allocated by the GC. The memory used internally by a to store your
myclass*'s is not.

See other messages today for how to fix that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://napali.hpl.hp.com/pipermail/gc/attachments/20130414/2bd4f824/attachment.htm

More information about the Gc mailing list