edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev]  gc
@ 2014-01-05  7:30 Karl Dahlke
  2014-01-05 13:46 ` Adam Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Karl Dahlke @ 2014-01-05  7:30 UTC (permalink / raw)
  To: Edbrowse-dev

> The problem for us is that we currently don't construct any of these
> RootedObject instances, which means that the SpiderMonkey internal GC

Really?
My layer calls, for example, JS_ConstructObjectWithArguments()
to make a new object,
I would suppose you replace that with some kind of js new call,
which implicitly or explicitly creates a new object in c++,
which calls the constructor you described,
and I would figure that's good enough to keep it around,
until we remove it, which use to be some kind of js_free,
now some kind of js_destroy,
and then the gc can clean up the loose ends,
and I'm sorry in advance if I'm oversimplifying it,
because I haven't looked at any of your code or how it works;
I just didn't expect a problem here.
Allocate becomes new construct, and all should be well.

Karl Dahlke

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Edbrowse-dev] gc
@ 2014-01-04 22:14 Karl Dahlke
  2014-01-04 22:42 ` Chris Brannon
  2014-01-04 22:52 ` Adam Thompson
  0 siblings, 2 replies; 6+ messages in thread
From: Karl Dahlke @ 2014-01-04 22:14 UTC (permalink / raw)
  To: Edbrowse-dev

I have always wondered about gc in c++.
It cannot be easy and straightforward like it is in java.
(One reason I was always afraid of c++)
So possibly void * won't work, like you have to tell the compiler
that it's a pointer to a certain object of a certain class,
for c++ to keep it around.
Or - maybe you have to explicitly set void * x = object * o
so that when it crosses the equals sign it tells gc
that it is off somewhere else and should not be deleted.
Unfortunately this is advanced stuff that won't be in my first line tutorial.
And then moz js may have its own internal gc.
That would be stupid, to reinvent what c++ has already done, but who knows.
We need to become not just competent in this stuff, but near experts.

Karl Dahlke

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-05 19:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-05  7:30 [Edbrowse-dev] gc Karl Dahlke
2014-01-05 13:46 ` Adam Thompson
2014-01-05 19:52   ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-01-04 22:14 Karl Dahlke
2014-01-04 22:42 ` Chris Brannon
2014-01-04 22:52 ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).