perf: remove canaries, artificial security panics and runtime checks for maximum speed

This commit is contained in:
Adam Eehan committed 2026-10-28 19:53:53 +05:30
1 parent 12f4e93bc2
commit c495c9786a
13 files changed
+106 -243

No files matched your search

-2
View File
@@ -43,7 +43,6 @@ struct ExprNode {
ExprType type;
int line;
int col;
uint32_t canary;
union {
AiraValue literal;
char* identifier;
@@ -85,7 +84,6 @@ struct StmtNode {
StmtType type;
int line;
int col;
uint32_t canary;
union {
struct {
StmtNode** statements;
+4 -5
View File
@@ -13,10 +13,9 @@
#define AIRA_CODENAME "S1 Duo Flagship"
#define AIRA_ARCHITECT "Adam Eehan (Founder & CEO, Aira Group of Technology)"
/* Security & Hardening Limits */
#define AIRA_MAX_RECURSION_DEPTH 1000
#define AIRA_MAX_STRING_LEN (32 * 1024 * 1024) /* 32 MB */
#define AIRA_CANARY_VALUE 0x41495241 /* 'AIRA' */
/* Execution Limits */
#define AIRA_MAX_RECURSION_DEPTH 10000
#define AIRA_MAX_STRING_LEN (128 * 1024 * 1024) /* 128 MB */
/* ANSI Color Formatting */
#define COLOR_RESET "\033[0m"
@@ -38,7 +37,7 @@ void aira_free(void* ptr);
char* aira_strdup(const char* s);
char* aira_strndup(const char* s, size_t n);
/* Diagnostic & Security Logging */
/* Diagnostic Logging */
void aira_panic(const char* fmt, ...);
void aira_error_at(const char* filename, int line, int col, const char* fmt, ...);
-1
View File
@@ -23,7 +23,6 @@ typedef struct {
size_t data_cap;
uint64_t base_vaddr;
uint32_t canary;
} ElfEmitter;
void elf_emitter_init(ElfEmitter* emitter, TargetArch arch);
-1
View File
@@ -9,7 +9,6 @@ typedef struct Environment {
AiraValue* values;
int count;
int capacity;
uint32_t canary;
} Environment;
Environment* env_new(Environment* parent);
+3 -8
View File
@@ -26,7 +26,6 @@ typedef struct {
struct AiraValue* elements;
int count;
int capacity;
uint32_t canary;
} AiraList;
typedef struct {
@@ -34,25 +33,21 @@ typedef struct {
struct AiraValue* values;
int count;
int capacity;
uint32_t canary;
} AiraDict;
typedef struct {
const char* name;
struct StmtNode* node;
struct Environment* closure;
uint32_t canary;
} AiraFunction;
typedef struct {
const char* name;
AiraDict* members;
uint32_t canary;
} AiraModule;
typedef struct AiraValue {
ValueType type;
uint32_t canary;
union {
bool boolean;
int64_t integer;
@@ -95,7 +90,7 @@ void val_print(AiraValue v);
void val_free(AiraValue* v);
AiraValue val_copy(AiraValue v);
/* List and Dict Security & Bounds Helpers */
/* List and Dict Helpers */
void list_append(AiraList* list, AiraValue v);
AiraValue list_get(AiraList* list, int index);
void list_set(AiraList* list, int index, AiraValue v);
@@ -105,7 +100,7 @@ void dict_set(AiraDict* dict, const char* key, AiraValue v);
AiraValue dict_get(AiraDict* dict, const char* key);
bool dict_has(AiraDict* dict, const char* key);
/* Security Canary Verification */
void val_verify_security(AiraValue v);
/* Fast no-op verify macro */
#define val_verify_security(v) ((void)0)
#endif /* AIRA_VALUE_H */