Upgraded to SM 60

This commit is contained in:
Alan Jeffrey 2018-06-01 17:24:25 -05:00 committed by Josh Matthews
parent d34403047e
commit 74c1e00d81
290 changed files with 26572 additions and 1178 deletions

View file

@ -517,14 +517,14 @@ impl WorkletThread {
/// The current memory usage of the thread
#[allow(unsafe_code)]
fn current_memory_usage(&self) -> u32 {
unsafe { JS_GetGCParameter(self.runtime.rt(), JSGCParamKey::JSGC_BYTES) }
unsafe { JS_GetGCParameter(self.runtime.cx(), JSGCParamKey::JSGC_BYTES) }
}
/// Perform a GC.
#[allow(unsafe_code)]
fn gc(&mut self) {
debug!("BEGIN GC (usage = {}, threshold = {}).", self.current_memory_usage(), self.gc_threshold);
unsafe { JS_GC(self.runtime.rt()) };
unsafe { JS_GC(self.runtime.cx()) };
self.gc_threshold = max(MIN_GC_THRESHOLD, self.current_memory_usage() * 2);
debug!("END GC (usage = {}, threshold = {}).", self.current_memory_usage(), self.gc_threshold);
}