Skip to main content

BufferRuntime

Trait BufferRuntime 

Source
pub trait BufferRuntime: Sealed {
    // Required methods
    unsafe fn new_buffer_internal(&self, size: usize) -> VmErrorResult<Buffer>;
    unsafe fn free_buffer(&self, buffer: Buffer, page: LuaPage);
}
Expand description

Unstable buffer allocation capability.

§Safety

Every operation requires a live thread and buffer/page handles from that thread’s VM. Sizes and deallocation pages must describe the original allocation, and callers must preserve GC reachability while operating.

Required Methods§

Source

unsafe fn new_buffer_internal(&self, size: usize) -> VmErrorResult<Buffer>

luaB_newbuffer

Source

unsafe fn free_buffer(&self, buffer: Buffer, page: LuaPage)

luaB_freebuffer

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§