big
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{ stdenv
|
||||
, callPackage
|
||||
, bdwgc ? callPackage ./bdwgc.nix {}
|
||||
, bdwgc ? callPackage ../bdwgc.nix {}
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include "gyehoek.h"
|
||||
|
||||
int blah () {
|
||||
puts ("aaa");
|
||||
SCM scm_write (SCM x) {
|
||||
if (SCM_IMP (x)) {
|
||||
printf ("#<immediate %ld>\n", SCM_UNPACK (x));
|
||||
} else {
|
||||
printf ("#<heap object %ld>\n", SCM_UNPACK(x));
|
||||
}
|
||||
return SCM_PACK(NULL);
|
||||
}
|
||||
|
||||
23
runtime/gyehoek.h
Normal file
23
runtime/gyehoek.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef GYEHOEK_H
|
||||
#define GYEHOEK_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
typedef uintptr_t scm_t_bits;
|
||||
|
||||
typedef union SCM { struct { scm_t_bits n; } n; } SCM;
|
||||
|
||||
#define SCM_UNPACK(x) ((x).n.n)
|
||||
#define SCM_PACK(x) ((SCM) { { (scm_t_bits) (x) } })
|
||||
#define SCM_IMP(x) (6 & SCM_UNPACK (x))
|
||||
#define SCM_NIMP(x) (!SCM_IMP (x))
|
||||
#define SCM_HEAP_OBJECT_P(x) (SCM_NIMP (x))
|
||||
|
||||
|
||||
|
||||
SCM scm_write (SCM);
|
||||
|
||||
|
||||
#endif /* GYEHOEK_H */
|
||||
Reference in New Issue
Block a user