cairo_lang_sierra/extensions/modules/
segment_arena.rs

1use crate::extensions::NoGenericArgsGenericType;
2use crate::ids::GenericTypeId;
3
4/// Type for the Segment Arena builtin.
5///
6/// This type should be initialized and destructed by the OS.
7/// It is assumed to be a pointer to a segment containing the following struct:
8/// A data segment start.
9/// Number of segments in the data segment.
10/// Number of destructed segments.
11/// On each new segment/segment finalization the struct is appended to the buffer and the returned
12/// pointer is incremented accordingly.
13/// The data segment contains the following info for each allocated segment:
14/// The start of the segment (written on allocation).
15/// The end of the segment (written on finalization).
16/// A sequential number of the segment when destructed (written on finalize).
17#[derive(Default)]
18pub struct SegmentArenaType {}
19impl NoGenericArgsGenericType for SegmentArenaType {
20    const ID: GenericTypeId = GenericTypeId::new_inline("SegmentArena");
21    const STORABLE: bool = true;
22    const DUPLICATABLE: bool = false;
23    const DROPPABLE: bool = false;
24    const ZERO_SIZED: bool = false;
25}