()
#import "Runtime_Support";
Module parameters#
- DEFINE_SYSTEM_ENTRY_POINT: bool
- Defines the program's system entry point.
- DEFINE_INITIALIZATION: bool
- Defines the initialization that runs before
main. - ENABLE_BACKTRACE_ON_CRASH: bool
- Installs the crash handler that prints a backtrace.
Procedures#
General#
()
(argc: s32, argv: **u8) -> *#Context
(_context: *void)
(start: *u8, num_elements: s64, size: s64)
(str: *u8) -> s64
(c_string: *u8) -> string
(s: string, to_standard_error := false)
(s: string, to_standard_error := false)
(strings: ..string, to_standard_error := false)
(force := false)
(n: u64, base := 10, to_standard_error := false)
(n: s64, base := 10, to_standard_error := false)
(loc: Source_Code_Location, message: string) -> bool
(message: string, data: *void, info: Log_Info)
()
()
Faults#
(index: s64, limit: s64, line_number: s64, filename: *u8)
(pre_value: s64, pre_flags: u32, post_value: s64, post_flags: u32, fatal: u8, line_number: s64, filename: *u8)
(index: s64, line_number: s64, filename: *u8)
(left: s64, right: s64, type_code: u16, line_number: s64, filename: *u8)
(synch_value: *s32, to_insert: Code)
Default heaps#
(mode: Allocator_Mode, requested_size: s64, old_size: s64, old_memory: *void, allocator_data: *void) -> *void
The allocator procedure. It handles .ALLOCATE, .RESIZE, .FREE, .CREATE_HEAP, .DESTROY_HEAP and .IS_THIS_YOURS; allocator_data is the heap, or null for the default one. Allocation returns null when the size is invalid or memory runs out.
memory := cast(*u8) allocator_proc(.ALLOCATE, 8, 0, null, null);
memset(memory, 7, 8);
grown := cast(*u8) allocator_proc(.RESIZE, 64, 8, memory, null);
assert(grown[7] == 7);
allocator_proc(.FREE, 0, 64, grown, null);↗Types#
:: struct
- context_info: *Type_Info_Struct
- thread_index: u32
- allocator: := default_allocator
- logger: := runtime_support_default_logger
- logger_data: *void
- log_source_identifier: u64
- log_level: Log_Level
- temporary_storage: *Temporary_Storage
- stack_trace: *Stack_Trace_Node
- assertion_failed: := runtime_support_assertion_failed
- handling_assertion_failure: := false
:: struct
- data: *u8
- size: s64
- total_bytes_occupied: s64
- high_water_mark: s64
- last_set_mark_location: Source_Code_Location
- implementation_data: [256] u8
Constants#
:: OS == .MACOS || OS == .LINUX || OS == .PS5 || OS == .IOS || OS == .ANDROID