script::dom::bindings::import::module

Trait GCMethods

Source
pub(crate) trait GCMethods: Initialize {
    // Required method
    unsafe fn post_barrier(v: *mut Self, prev: Self, next: Self);

    // Provided method
    unsafe fn initial() -> Self { ... }
}
Expand description

A trait for types which can place appropriate GC barriers.

  • https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Garbage_collection#Incremental_marking
  • https://dxr.mozilla.org/mozilla-central/source/js/src/gc/Barrier.h

Required Methods§

Source

unsafe fn post_barrier(v: *mut Self, prev: Self, next: Self)

Place a post-write barrier

Provided Methods§

Source

unsafe fn initial() -> Self

Create a default value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GCMethods for *mut JSObject

Source§

impl GCMethods for *mut BigInt

Source§

impl GCMethods for *mut JSFunction

Source§

impl GCMethods for *mut JSScript

Source§

impl GCMethods for *mut JSString

Source§

impl GCMethods for *mut Symbol

Implementors§