From: Chris Brannon <chris@the-brannons.com>
To: edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] garbage collection1
Date: Fri, 24 Jan 2014 14:07:27 -0800 [thread overview]
Message-ID: <87mwilowyo.fsf@mushroom.PK5001Z> (raw)
In-Reply-To: <20140124145833.GE12450@toaster.adamthompson.me.uk> (Adam Thompson's message of "Fri, 24 Jan 2014 14:58:33 +0000")
Adam Thompson <arthompson1990@gmail.com> writes:
> In addition I think we need to change the establish_property_* functions to take
> JS::Handle and js::MutableHandle arguments.
Yes, I think so, but this is going to cause problems, since other
functions in html.c call establish_property_*, and those don't know
about C++ types.
But you're on to something...
The rooting guide [1] says that we should basically never use raw pointers.
Why? Because Spidermonkey doesn't know about them, and it will happily
invalidate them during a garbage collection.
But we're using them a lot. Here's a stretch of code that could crash
the program. It starts at line 544 of html.c and ends at line 564.
e is a raw pointer to something in the JS heap, and each one of those
establish_property_* calls could move it.
So I think it might be time to make html.c compilable with g++ and move
over to the appropriate SpiderMonkey types. I'm
willing to do this work if you need a break.
-- Chris
prev parent reply other threads:[~2014-01-24 22:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 20:27 [Edbrowse-dev] garbage collection Chris Brannon
2014-01-24 10:59 ` [Edbrowse-dev] garbage collection1 Adam Thompson
2014-01-24 14:21 ` Chris Brannon
2014-01-24 14:58 ` Adam Thompson
2014-01-24 22:07 ` Chris Brannon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mwilowyo.fsf@mushroom.PK5001Z \
--to=chris@the-brannons.com \
--cc=edbrowse-dev@lists.the-brannons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).