pub struct TableInner {
pub flags: TableFlags,
pub lsizenode: u8,
pub alimit: u32,
pub array: Box<[LuaValue]>,
pub node: Box<[TableNode]>,
pub lastfree: u32,
}Expand description
Hybrid array + hash storage backing a LuaTable.
All mutating algorithms live as &mut TableInner methods so they
can be called from the outer &self API via RefCell::borrow_mut.
Fields§
§flags: TableFlags§lsizenode: u8§alimit: u32§array: Box<[LuaValue]>Array part. A boxed slice — no capacity field — because it only ever
changes size at a resize/rehash boundary, never via incremental
push, mirroring C’s raw TValue *array whose length lives in
alimit. Growth and shrink rebuild a fresh box in
TableInner::resize.
node: Box<[TableNode]>Hash part. A boxed slice for the same reason as array: every node
vector is built whole in TableInner::set_node_vector and swapped
in, mirroring C’s Node *node sized by lsizenode.
lastfree: u32Free-slot search cursor for get_free_pos; NO_LASTFREE means the
table has no allocated hash part (isdummy in C). Stored as a u32
sentinel rather than Option<usize> to keep the struct compact
(W2.3 representation diet); hash parts are capped well below 2^32.