#[repr(C)]pub struct MapObj {
pub object: Object,
pub data: *mut c_void,
pub size: u64,
pub slots: u64,
}Expand description
Container object for Map. The header fields mirror C++ MapBaseObj
(include/tvm/ffi/container/map_base.h) so Map::len can read size
without an FFI call; the storage data points to stays opaque.
This is a partial mirror by design: MapBaseObj has one more trailing field
after slots_ (a data_deleter_ function pointer), omitted here because this
binding is read-only — it only reads fields up to size, which precede it,
and never allocates a MapObj itself (the C++ runtime allocates the larger
Small/DenseMapBaseObj subclass), so the trailing field is never touched.
The layout also assumes TVM_FFI_DEBUG_WITH_ABI_CHANGE is off (the default):
with that debug flag set, MapBaseObj gains a leading state_marker field
that would shift every offset below.
Fields§
§object: Object§data: *mut c_voidPointer to the (opaque) key/value storage region (MapBaseObj::data_).
size: u64Number of entries (MapBaseObj::size_).
slots: u64Number of hash slots; the MSB is a small-map tag (MapBaseObj::slots_).