mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Upgraded to SM 60
This commit is contained in:
parent
d34403047e
commit
74c1e00d81
290 changed files with 26572 additions and 1178 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue