move some headers & defs around
This commit is contained in:
parent
899175f48b
commit
50e76c8c04
@ -26,10 +26,7 @@ static void gsReserve(u64 am) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GS_REALLOC
|
static NOINLINE void gsReserveR(u64 am) { gsReserve(am); }
|
||||||
NOINLINE
|
|
||||||
#endif
|
|
||||||
static void gsReserveR(u64 am) { gsReserve(am); }
|
|
||||||
|
|
||||||
|
|
||||||
static inline void gsAdd(B x) {
|
static inline void gsAdd(B x) {
|
||||||
|
|||||||
@ -8,6 +8,28 @@ B bi_N, bi_noVar, bi_badHdr, bi_optOut, bi_noFill, bi_emptyHVec, bi_emptyIVec, b
|
|||||||
CTR_FOR(F)
|
CTR_FOR(F)
|
||||||
#undef F
|
#undef F
|
||||||
|
|
||||||
|
char* format_pf(u8 u) {
|
||||||
|
switch(u) { default: return "(unknown function)";
|
||||||
|
#define F(N,X) case pf_##N: return X;
|
||||||
|
FOR_PFN(F,F,F)
|
||||||
|
#undef F
|
||||||
|
}
|
||||||
|
}
|
||||||
|
char* format_pm1(u8 u) {
|
||||||
|
switch(u) { default: return"(unknown 1-modifier)";
|
||||||
|
#define F(N,X) case pm1_##N: return X;
|
||||||
|
FOR_PM1(F,F,F)
|
||||||
|
#undef F
|
||||||
|
}
|
||||||
|
}
|
||||||
|
char* format_pm2(u8 u) {
|
||||||
|
switch(u) { default: return"(unknown 2-modifier)";
|
||||||
|
#define F(N,X) case pm2_##N: return X;
|
||||||
|
FOR_PM2(F,F,F)
|
||||||
|
#undef F
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NOINLINE void arr_print(B x) { // should accept refc=0 arguments for debugging purposes
|
NOINLINE void arr_print(B x) { // should accept refc=0 arguments for debugging purposes
|
||||||
ur r = rnk(x);
|
ur r = rnk(x);
|
||||||
BS2B xgetU = TI(x).getU;
|
BS2B xgetU = TI(x).getU;
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
extern u64 allocB; // currently allocated number of bytes
|
extern u64 allocB; // currently allocated number of bytes
|
||||||
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
// memory defs
|
// memory defs
|
||||||
|
|
||||||
@ -130,6 +128,9 @@ NOINLINE B append_fmt(B s, char* p, ...);
|
|||||||
|
|
||||||
// function stuff
|
// function stuff
|
||||||
|
|
||||||
|
char* format_pf(u8 u);
|
||||||
|
char* format_pm1(u8 u);
|
||||||
|
char* format_pm2(u8 u);
|
||||||
bool isPureFn(B x); // doesn't consume
|
bool isPureFn(B x); // doesn't consume
|
||||||
B bqn_merge(B x); // consumes
|
B bqn_merge(B x); // consumes
|
||||||
B bqn_squeeze(B x); // consumes
|
B bqn_squeeze(B x); // consumes
|
||||||
|
|||||||
25
src/h.h
25
src/h.h
@ -185,35 +185,10 @@ enum PrimMd2 { pm2_none,
|
|||||||
#undef F
|
#undef F
|
||||||
};
|
};
|
||||||
|
|
||||||
static char* format_pf(u8 u) {
|
|
||||||
switch(u) { default: return "(unknown function)";
|
|
||||||
#define F(N,X) case pf_##N: return X;
|
|
||||||
FOR_PFN(F,F,F)
|
|
||||||
#undef F
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static char* format_pm1(u8 u) {
|
|
||||||
switch(u) { default: return"(unknown 1-modifier)";
|
|
||||||
#define F(N,X) case pm1_##N: return X;
|
|
||||||
FOR_PM1(F,F,F)
|
|
||||||
#undef F
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static char* format_pm2(u8 u) {
|
|
||||||
switch(u) { default: return"(unknown 2-modifier)";
|
|
||||||
#define F(N,X) case pm2_##N: return X;
|
|
||||||
FOR_PM2(F,F,F)
|
|
||||||
#undef F
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#define F(N,X) extern B bi_##N;
|
#define F(N,X) extern B bi_##N;
|
||||||
FOR_PFN(F,F,F)
|
FOR_PFN(F,F,F)
|
||||||
#undef F
|
|
||||||
#define F(N,X) extern B bi_##N;
|
|
||||||
FOR_PM1(F,F,F)
|
FOR_PM1(F,F,F)
|
||||||
#undef F
|
|
||||||
#define F(N,X) extern B bi_##N;
|
|
||||||
FOR_PM2(F,F,F)
|
FOR_PM2(F,F,F)
|
||||||
#undef F
|
#undef F
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
typedef struct EmptyValue EmptyValue;
|
typedef struct EmptyValue EmptyValue;
|
||||||
struct EmptyValue { // needs set: mmInfo; type=t_empty; next; everything else can be garbage
|
struct EmptyValue { // needs set: mmInfo; type=t_empty; next; everything else can be garbage
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
typedef struct EmptyValue EmptyValue;
|
typedef struct EmptyValue EmptyValue;
|
||||||
struct EmptyValue { // needs set: mmInfo; type=t_empty; next; everything else can be garbage
|
struct EmptyValue { // needs set: mmInfo; type=t_empty; next; everything else can be garbage
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user