1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// ===============================================================================
// QUANTALANG RUNTIME SUPPORT
// ===============================================================================
// Copyright (c) 2022-2026 Zain Dana Harper. MIT License.
// ===============================================================================
//! Runtime support for QuantaLang programs.
//!
//! This module provides runtime infrastructure including:
//! - Foreign Function Interface (FFI) for C interop
//! - Garbage collection (reference counting + cycle detection)
//! - Async runtime with work-stealing scheduler
//!
//! ## FFI Example
//!
//! ```quanta
//! extern "C" {
//! fn printf(format: *const i8, ...) -> i32;
//! fn malloc(size: usize) -> *mut u8;
//! fn free(ptr: *mut u8);
//! }
//!
//! @[link(name = "mylib")]
//! extern "C" {
//! fn my_function(x: i32) -> i32;
//! }
//! ```
//!
//! ## Memory Management
//!
//! ```quanta
//! // Automatic reference counting
//! let obj = Box::new(MyStruct { value: 42 });
//!
//! // Manual memory via FFI
//! unsafe {
//! let ptr = malloc(1024);
//! // ... use memory ...
//! free(ptr);
//! }
//! ```
pub use *;
pub use *;
pub use *;