mirror of
https://github.com/CPunch/Laika.git
synced 2025-09-25 19:30:22 +00:00
Forced inlining for both GCC/clang & MSVC
This commit is contained in:
@@ -13,9 +13,15 @@
|
||||
#define ARRAY_START 4
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout);
|
||||
# define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout);
|
||||
#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
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "laika.h"
|
||||
#include "lvm.h"
|
||||
|
||||
/* Laika Box:
|
||||
@@ -22,12 +23,12 @@ struct sLaikaB_box {
|
||||
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 */
|
||||
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 "laika.h"
|
||||
#include "lerror.h"
|
||||
|
||||
#define LAIKA_VM_CODESIZE 512
|
||||
@@ -58,7 +59,7 @@ enum {
|
||||
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 BINOP(x) { \
|
||||
|
Reference in New Issue
Block a user