mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-22 04:50:06 +00:00
Forced inlining for both GCC/clang & MSVC
This commit is contained in:
parent
64f7e40fa0
commit
9cea98c86a
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -30,7 +30,10 @@
|
|||||||
"alloca.h": "c",
|
"alloca.h": "c",
|
||||||
"bot.h": "c",
|
"bot.h": "c",
|
||||||
"string_view": "c",
|
"string_view": "c",
|
||||||
"lconfig.h": "c"
|
"lconfig.h": "c",
|
||||||
|
"inttypes.h": "c",
|
||||||
|
"time.h": "c",
|
||||||
|
"features.h": "c"
|
||||||
},
|
},
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"cnc's",
|
"cnc's",
|
||||||
|
@ -13,9 +13,15 @@
|
|||||||
#define ARRAY_START 4
|
#define ARRAY_START 4
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout);
|
# define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout);
|
||||||
#else
|
#else
|
||||||
#define LAIKA_DEBUG(...) ((void)0) /* no op */
|
# define LAIKA_DEBUG(...) ((void)0) /* no op */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
# define LAIKA_FORCEINLINE __attribute__((always_inline)) inline
|
||||||
|
#else
|
||||||
|
# define LAIKA_FORCEINLINE __forceinline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "laika.h"
|
||||||
#include "lvm.h"
|
#include "lvm.h"
|
||||||
|
|
||||||
/* Laika Box:
|
/* Laika Box:
|
||||||
@ -22,12 +23,12 @@ struct sLaikaB_box {
|
|||||||
struct sLaikaV_vm vm;
|
struct sLaikaV_vm vm;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void laikaB_unlock(struct sLaikaB_box *box) {
|
LAIKA_FORCEINLINE void laikaB_unlock(struct sLaikaB_box *box) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* safely free's allocated buffer using libsodium's api for clearing sensitive data from memory */
|
/* safely free's allocated buffer using libsodium's api for clearing sensitive data from memory */
|
||||||
inline void laikaB_lock(struct sLaikaB_box *box) {
|
LAIKA_FORCEINLINE void laikaB_lock(struct sLaikaB_box *box) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "laika.h"
|
||||||
#include "lerror.h"
|
#include "lerror.h"
|
||||||
|
|
||||||
#define LAIKA_VM_CODESIZE 512
|
#define LAIKA_VM_CODESIZE 512
|
||||||
@ -58,7 +59,7 @@ enum {
|
|||||||
OP_TESTJMP, /* if stk_indx[uint8_t] != 0, pc += [uint8_t] */
|
OP_TESTJMP, /* if stk_indx[uint8_t] != 0, pc += [uint8_t] */
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void laikaV_execute(struct sLaikaV_vm *vm) {
|
LAIKA_FORCEINLINE void laikaV_execute(struct sLaikaV_vm *vm) {
|
||||||
|
|
||||||
#define READBYTE (vm->code[vm->pc++])
|
#define READBYTE (vm->code[vm->pc++])
|
||||||
#define BINOP(x) { \
|
#define BINOP(x) { \
|
||||||
|
Loading…
Reference in New Issue
Block a user