mozjs::rust

Trait GCMethods

source
pub 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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GCMethods for *mut BigInt

source§

impl GCMethods for *mut Symbol

source§

impl GCMethods for *mut JSFunction

source§

impl GCMethods for *mut JSObject

source§

impl GCMethods for *mut JSScript

source§

impl GCMethods for *mut JSString

Implementors§