Version 1 (modified by Yves, 10 years ago) ( diff )

--

The GC Rooting Guide and the guide for Exact Stack Rooting give a first overview, but there's still a lot to figure out. For the upgrade to ESR24 I've decided to avoid this topic because it's way to complicated and extensive to do it at the same time as the upgrade, but I'd still like to make some notes about important things I figure out.

Use cases and examples

Implicit conversion to JS::Value

Implicit conversion from JS::RootedValue, JS::HandleValue and JS::MutableHandle to JS::Value allows us using a rooted type at the top of a chain of functions that are not migrated yet. This does not work with JS::Value pointer arguments unfortunately. The following code is valid:

void bar(JS::Value val)
{	
}

void foo(JSContext* cx, JS::HandleValue handleVal, JS::MutableHandleValue mutableHandleVal)
{
	JS::RootedValue val(cx);
	bar(val);
	bar(handleVal);
	bar(mutableHandleVal);
}

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.