Buffer
Internal FFI helpers for the Symphonia package, so the decoder never touches stdPolyfills.ffi directly.
Zune does not write back through a Luau buffer passed as a pointer, so everything libsymphonia writes into (PCM,
packets, names and error text) is native memory from alloc. Inputs (file bytes, paths and extensions) are passed
as Luau buffers, which Zune reads directly.
Summary
Functions
Section titled “Functions”Buffer . alloc ( size ) -> FFIPointer
Allocates size bytes of native memory from the pooled allocator.
Parameters
| size: number |
Returns
| FFIPointer |
Buffer . free ( pointer ) -> ()
Returns native memory from alloc to the pool.
Parameters
| pointer: FFIPointer |
Buffer . read ( pointer , length ) -> buffer
Copies the first length bytes at pointer into a new Luau buffer.
Parameters
| pointer: FFIPointer | |
| length: number |
Returns
| buffer |
getNull
Section titled “getNull”Buffer . getNull ( ) -> FFIPointer
Returns the null pointer, for an optional pointer argument left out.
Returns
| FFIPointer |
fromCString
Section titled “fromCString”Buffer . fromCString ( pointer , capacity ) -> string
Reads the NUL-terminated string at pointer, at most capacity bytes long.
cString
Section titled “cString”Buffer . cString ( text ) -> buffer
Returns text with a NUL terminator as a Luau buffer, to pass as a C string.
Parameters
| text: string |
Returns
| buffer |