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

> For example the JS_ValueToString function explicitly says
> that you should protect its return value with a GC root or the string is
> at risk of garbage collection at any stage.

Well edbrowse is not multithreaded.
Within the one and only thread, I immediately make that js value
a property in some other object; I immediately link it to the window tree.
That's why I made it a js string in the first place.
Thus it is referenced.
I keep thinking there should be no trouble.

> Theoretically most of our objects should be protected from GC

Theoretically all of our objects should be protected from GC, unless I did something wrong.

> Admittedly some of this rooting may be paranoia,

And that's ok, I guess, unless we are setting up excess reference counts,
and those objects never go away, even when they aren't used any more,
because the reference count never drops to 0,
and edbrowse has memory leaks.
People like me really are in edbrowse for hours at a time.
So I'm not sure we should swing the big hammer and root everything.
At an intellectual level I'd like to know why everything isn't
already rooted to jswin.

Of course you're doing all the work, not me,
and if rooting everything will get us off the ground,
and get rid of seg faults,
then we can watch for and fix memory leaks later.
I do understand that sometimes you just have to move forward.

Karl Dahlke

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [Edbrowse-dev] window root
@ 2014-01-06  0:55 Karl Dahlke
  2014-01-06  1:24 ` Chris Brannon
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Dahlke @ 2014-01-06  0:55 UTC (permalink / raw)
  To: Edbrowse-dev

> But don't worry, I'm *pretty sure* we're ok.
> The global object (jwin) should be rooted.
> I'm pretty sure that the JS objects we create and use are reachable from
> the global object, aren't they?

Yes this is what I thought too.
Every object is created under another, linking all the way back to jswin.
And so I still don't understand why there should be an issue.

Karl Dahlke

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

end of thread, other threads:[~2014-01-06 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-06 10:19 [Edbrowse-dev] window root Karl Dahlke
2014-01-06 13:05 ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-01-06  0:55 Karl Dahlke
2014-01-06  1:24 ` Chris Brannon
2014-01-06  9:46   ` 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).