Cyclone Scheme
0.28.0
|
Definitions and code for memory-allocated objects. More...
Modules | |
Safe pair access macros | |
Macros for safe pair access. | |
Unsafe pair access macros | |
Macros for fast - but unsafe - pair access. | |
Data Structures | |
struct | atomic_type |
The atomic thread synchronization type. More... | |
struct | bignum_type |
Exact integer of unlimited precision. More... | |
struct | boolean_type |
The boolean type: True or False. More... | |
struct | bytevector_type |
Bytevector type. More... | |
struct | c_opaque_type |
C Opaque type - a wrapper around a pointer of any type. More... | |
struct | closure0_type |
A closed-over function with no variables. More... | |
struct | closure1_type |
A closed-over function with one variable. More... | |
struct | closureN_type |
A closed-over function with zero or more closed-over variables. More... | |
union | common_type |
A union of all the constant-size objects. More... | |
struct | complex_num_type |
Complex number. More... | |
struct | cond_var_type |
The condition variable thread synchronization type. More... | |
struct | cvar_type |
C-variable integration type - wrapper around a Cyclone object pointer. More... | |
struct | double_type |
Double-precision floating point type, also known as a flonum. More... | |
struct | integer_type |
Deprecated - boxed integers. More... | |
struct | list_2_type |
struct | list_3_type |
struct | list_4_type |
struct | macro_type |
Closure for a macro. More... | |
struct | mutex_type |
The mutex thread synchronization type. More... | |
struct | pair_type |
The pair (cons) type. More... | |
struct | port_type |
The port object type. More... | |
struct | primitive_type |
A function built into the runtime. More... | |
struct | string_type |
The string type. More... | |
struct | symbol_type |
Symbols are similar to strings, but only one instance of each unique symbol is created, so comparisons are O(1). More... | |
struct | vector_2_type |
struct | vector_3_type |
struct | vector_4_type |
struct | vector_5_type |
struct | vector_type |
Vector type. More... | |
Macros | |
#define | alloc_bignum(data, p) bignum_type *p = gc_alloc_bignum((gc_thread_data *)data); |
#define | alloc_bytevector(_data, _bv, _len) |
#define | alloc_string(_data, _s, _len, _num_cp) |
#define | alloca_cell(n, a) alloca_pair(n,a,NULL) |
#define | alloca_complex_num(n, r, i) |
#define | alloca_double(n, v) |
#define | alloca_empty_bytevector(v) |
#define | alloca_empty_vector(v) |
#define | alloca_pair(n, a, d) |
#define | assign_complex_num(pobj, v) |
#define | assign_double(pobj, v) |
#define | BIGNUM_CALL(x) |
#define | bignum_value(x) (((bignum_type *) x)->bn) |
#define | boolean_desc(x) (((boolean_type *) x)->desc) |
#define | complex_num_value(x) (((complex_num_type *) x)->value) |
#define | CYC_BINARY_PORT_FLAG 0x10 |
#define | CYC_IO_BUF_LEN 1024 |
#define | defprimitive(name, desc, fnc) |
#define | defsymbol(name) static object quote_##name = NULL; |
#define | double_value(x) (((double_type *) x)->value) |
#define | forward(obj) (((pair_type *) obj)->pair_car) |
#define | integer_value(x) (((integer_type *) x)->value) |
#define | maclosure0(c, f, na) |
#define | make_boolean(x) (x ? boolean_t : boolean_f) |
#define | make_c_opaque(var, p) |
#define | make_cell(n, a) make_pair(n,a,NULL) |
#define | make_complex_num(n, r, i) |
#define | make_cvar(n, v) |
#define | make_double(n, v) |
#define | make_empty_bytevector(v) |
#define | make_empty_vector(v) |
#define | make_input_port(p, f, rl) |
#define | make_pair(n, a, d) |
#define | make_port(p, f, m) |
#define | make_string(cs, s) |
#define | make_string_noalloc(cs, s, length) |
#define | make_string_with_len(cs, s, length) |
#define | make_utf8_string(data, cs, s) |
#define | make_utf8_string_noalloc(cs, s, length) |
#define | make_utf8_string_with_len(cs, s, length, num_code_points) |
#define | mclosure0(c, f) static closure0_type c = { .hdr.mark = gc_color_red, .hdr.grayed = 0, .tag = closure0_tag, .fn = f, .num_args = -1 }; /* TODO: need a new macro that initializes num_args */ |
#define | mclosure1(c, f, a) |
#define | mmacro(c, f) |
#define | opaque_collect_ptr(x) (((c_opaque)x)->collect_ptr) |
#define | opaque_ptr(x) (((c_opaque)x)->ptr) |
#define | prim(x) (x && ((primitive)x)->tag == primitive_tag) |
#define | prim_name(x) (((primitive_type *) x)->desc) |
#define | return_copy(ptr, o) |
#define | set_cell_as_expr(n, a) set_pair_as_expr(n,a,NULL) |
#define | set_pair(n, a, d) |
#define | set_pair_as_expr(n, a, d) |
#define | string_len(x) (((string_type *) x)->len) |
#define | string_num_cp(x) (((string_type *) x)->num_cp) |
#define | string_str(x) (((string_type *) x)->str) |
#define | symbol_desc(x) (((symbol_type *) x)->desc) |
#define | type_of(obj) (((pair_type *) obj)->tag) |
Typedefs | |
typedef atomic_type * | atomic |
typedef boolean_type * | boolean |
typedef bytevector_type * | bytevector |
typedef c_opaque_type * | c_opaque |
typedef closure0_type * | closure |
typedef closure0_type * | closure0 |
typedef closure1_type * | closure1 |
typedef closureN_type * | closureN |
typedef cond_var_type * | cond_var |
typedef cvar_type * | cvar |
typedef void(* | function_type) (void *data, object clo, int argc, object *args) |
typedef object(* | inline_function_type) () |
typedef pair_type * | list |
typedef closure0_type * | macro |
typedef mutex_type * | mutex |
typedef void * | object |
typedef pair_type * | pair |
typedef primitive_type * | primitive |
typedef void(* | primitive_function_type) (void *data, object cont, object args) |
typedef symbol_type * | symbol |
typedef unsigned char | tag_type |
typedef vector_type * | vector |
Enumerations | |
enum | bn_cmp_type { CYC_BN_LTE = -2, CYC_BN_LT = MP_LT, CYC_BN_EQ = MP_EQ, CYC_BN_GT = MP_GT, CYC_BN_GTE = 2 } |
enum | object_tag { closure0_tag = 0, closure1_tag = 1, closureN_tag = 2, macro_tag = 3, boolean_tag = 4, bytevector_tag = 5, c_opaque_tag = 6, cond_var_tag = 7, cvar_tag = 8, double_tag = 9, eof_tag = 10, forward_tag = 11, integer_tag = 12, bignum_tag = 13, mutex_tag = 14, pair_tag = 15, port_tag = 16, primitive_tag = 17, string_tag = 18, symbol_tag = 19, vector_tag = 20, complex_num_tag = 21, atomic_tag = 22, void_tag = 23, record_tag = 24 } |
Variables | |
const object | boolean_f |
const object | boolean_t |
const object | Cyc_EOF |
const object | Cyc_RECORD_MARKER |
const object | Cyc_VOID |
const object | quote_void |
Definitions and code for memory-allocated objects.
Most Scheme data types are defined as object types.
Each object type contains a header for garbage collection and a tag that identifies the type of object, as well as any object-specific fields.
Most object types are allocated on the nursery (the C stack) and relocated to the garbage-collected heap during minor GC. It is only safe for an object on the nursery to be used by the thread that created it, as that object could be relocated at any time.