mirror of
https://github.com/false-schemers/skint.git
synced 2024-12-26 21:58:51 +01:00
faster closure access primitives
This commit is contained in:
parent
a6bc0339c0
commit
ec702f5097
1 changed files with 7 additions and 7 deletions
14
i.c
14
i.c
|
@ -89,13 +89,13 @@ static obj *init_modules(obj *r, obj *sp, obj *hp);
|
|||
#define VM_STACK_GSZ (VM_STACK_LEN-VM_STACK_RSZ)
|
||||
|
||||
/* vm closure representation */
|
||||
#ifdef VMCLO_AS_VECTOR
|
||||
#define isvmclo isvector
|
||||
#define vmcloref vectorref
|
||||
#define vmclolen vectorlen
|
||||
#define vmclobsz(c) hbsz((c)+1)
|
||||
#define hpushvmclo(c) (*--hp = obj_from_size(VECTOR_BTAG), hendblk((c)+1))
|
||||
#else /* as procedure with code vector */
|
||||
#ifdef NDEBUG /* quick */
|
||||
#define isvmclo(x) (isobjptr(x) && isobjptr(hblkref(x, 0)))
|
||||
#define vmcloref(x,i) hblkref(x, i)
|
||||
#define vmclolen(x) hblklen(x)
|
||||
#define vmclobsz(c) hbsz(c)
|
||||
#define hpushvmclo(c) hendblk(c)
|
||||
#else /* slow but thorough */
|
||||
#define isvmclo isprocedure
|
||||
#define vmcloref *procedureref
|
||||
#define vmclolen procedurelen
|
||||
|
|
Loading…
Reference in a new issue