luaur-ast 0.1.0

Lexer, parser, and AST for Luau (faithful Rust port).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::records::page::Page;

#[repr(C)]
#[derive(Debug)]
#[allow(non_camel_case_types)]
pub struct Allocator {
    pub(crate) root: *mut Page,
    pub(crate) offset: usize,
}

// Safety: The Allocator owns its pages and does not use thread-local storage.
// It is safe to send to another thread if the memory it manages is not being accessed.
unsafe impl Send for Allocator {}
unsafe impl Sync for Allocator {}