From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bk0-x234.google.com (mail-bk0-x234.google.com [IPv6:2a00:1450:4008:c01::234]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 7999277894 for ; Sun, 26 Jan 2014 15:42:08 -0800 (PST) Received: by mail-bk0-f52.google.com with SMTP id e11so2491427bkh.11 for ; Sun, 26 Jan 2014 15:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=cFvTPkxUC99w7uUFyTRDCFHYzjF5/bz1tDa3mlvq27A=; b=Xx3nBKUBx94tGpYFqss9iFuo8QBXrcSE1skwD3PplvNy8ATJ1ShPU35HYMJwIpxTIh IxpesFW52OasTm9b44o9zqjiD5qI1LO5jNgNZfRR4jPz5ccQ9iAlLdlwzYgMLTQ+bX9d XGxtyZ+YY/wrqgh021uKv7sZ333CPlKCwFhFq/G6Ujebwhc7N+a5uTJ1dh50KM2VanLA 5T1S2hsU+wbzRQltFpPfs21pFZTjhKpUjW9IzE4MWfeN7SCQHmdF03MJavxsocLOVCwy YKqVhBk9+skbJfB6ZAsmhS7yEsNphk5fP/JVQ0nNumX7RKioSj84hI8ZIRBIMt3l6dMf dNVA== X-Received: by 10.205.77.131 with SMTP id zi3mr11211bkb.101.1390779707842; Sun, 26 Jan 2014 15:41:47 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id ch4sm11493643bkc.8.2014.01.26.15.41.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 26 Jan 2014 15:41:46 -0800 (PST) Date: Sun, 26 Jan 2014 23:41:27 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140126234127.GA17921@toaster.adamthompson.me.uk> References: <20140025114736.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140025114736.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] gc rooted X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2014 23:42:09 -0000 On Sat, Jan 25, 2014 at 11:47:36AM -0500, Karl Dahlke wrote: > I finally read the gc rooted guide, and it makes my head spin, > especially since I am still learning C++ on top of it. > > I wanted to start at the heart of the matter, jwin, > which is a global pointer to a js object. Yeah, I basically use JS_AddObjectRoot to root jwin when it's created in createJavaContext. This fixes the jwin rooting issue for the moment but as we've now got a c++ html parser (html.cpp) we can and should go for the opaque js struct. In addition: JS::RootedObject *jwin = new JS::RootedObjet Is (I think) according to the gc rooting guide a really bad idea since it keeps a rooted object on the heap which is illegal (it's only valid for the stack). Cheers, Adam.