mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-02-03 01:20:03 +00:00
implemented jump table dispatch
- currently only enabled on supported platforms (GNU C Compiler + Clang) - when enabled, sped up examples/fibtest.cosmo by about 20% (avg of 11.179s prior and 8.799 after) NOTE: malicious dumps can trivially cause crashes now by having junk function chunks
This commit is contained in:
10
src/cosmo.h
10
src/cosmo.h
@@ -14,7 +14,15 @@
|
||||
performance, however this will produce undefined behavior as you reach the stack limit (and may
|
||||
cause a seg fault!). It is recommended to keep this enabled.
|
||||
*/
|
||||
#define SAFE_STACK
|
||||
// #define SAFE_STACK
|
||||
|
||||
/*
|
||||
NAN_BOXXED:
|
||||
if undefined, the interpreter will use a tagged union to store values. This is the default.
|
||||
Note that even though the sizeof(CValue) is 8 bytes for NAN_BOXXED (as opposed to 16 bytes for
|
||||
the tagged union) no performance benefits were measured. I recommend keeping this undefined for
|
||||
now.
|
||||
*/
|
||||
// #define NAN_BOXXED
|
||||
|
||||
// forward declare *most* stuff so our headers are cleaner
|
||||
|
||||
Reference in New Issue
Block a user