mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added new alloca macros
This commit is contained in:
parent
16e1600662
commit
765f6ffd8d
1 changed files with 22 additions and 0 deletions
|
@ -748,6 +748,13 @@ typedef struct {
|
|||
n.tag = complex_num_tag; \
|
||||
n.value = (r + (i * I));
|
||||
|
||||
#define alloca_complex_num(n,r,i) \
|
||||
complex_num_type *n = alloca(sizeof(complex_num_type)); \
|
||||
n->hdr.mark = gc_color_red; \
|
||||
n->hdr.grayed = 0; \
|
||||
n->tag = complex_num_tag; \
|
||||
n->value = (r + (i * I));
|
||||
|
||||
/** Assign given complex value to the given complex number object pointer */
|
||||
#define assign_complex_num(pobj,v) \
|
||||
((complex_num_type *)pobj)->hdr.mark = gc_color_red; \
|
||||
|
@ -772,6 +779,13 @@ typedef struct {
|
|||
n.tag = double_tag; \
|
||||
n.value = v;
|
||||
|
||||
#define alloca_double(n,v) \
|
||||
double_type *n = alloca(sizeof(double_type)); \
|
||||
n->hdr.mark = gc_color_red; \
|
||||
n->hdr.grayed = 0; \
|
||||
n->tag = double_tag; \
|
||||
n->value = v;
|
||||
|
||||
/** Assign given double value to the given double object pointer */
|
||||
#define assign_double(pobj,v) \
|
||||
((double_type *)pobj)->hdr.mark = gc_color_red; \
|
||||
|
@ -1067,6 +1081,14 @@ typedef bytevector_type *bytevector;
|
|||
v.len = 0; \
|
||||
v.data = NULL;
|
||||
|
||||
#define alloca_empty_bytevector(v) \
|
||||
bytevector_type *v = alloca(sizeof(bytevector_type)); \
|
||||
v->hdr.mark = gc_color_red; \
|
||||
v->hdr.grayed = 0; \
|
||||
v->tag = bytevector_tag; \
|
||||
v->len = 0; \
|
||||
v->data = NULL;
|
||||
|
||||
/**
|
||||
* @brief The pair (cons) type.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue