Rename files and add some docs.

This commit is contained in:
Bob Nystrom
2013-11-28 08:11:50 -08:00
parent 9d9f9c11ca
commit 715fecdc7c
11 changed files with 75 additions and 45 deletions
+39
View File
@@ -0,0 +1,39 @@
#ifndef wren_common_h
#define wren_common_h
// This header contains macros and defines used across the entire Wren
// implementation. In particular, it contains "configuration" defines that
// control how Wren works. Some of these are only used while hacking on
// debugging Wren itself.
//
// This header is *not* intended to be included by code outside of Wren itself.
// Define this to stress test the GC. It will perform a collection before every
// allocation.
//#define DEBUG_GC_STRESS
// Define this to log memory operations.
//#define TRACE_MEMORY
#define NAN_TAGGING
// If this is set, the VM's interpreter loop uses computed gotos. See this for
// more: http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Labels-as-Values.html
// TODO(bob): Automatically define this based on whether or not it's supported.
#define COMPUTED_GOTOS
#ifdef DEBUG
#define ASSERT(condition, message) \
if (!(condition)) { \
printf("ASSERT FAIL " __FILE__ ":%d - %s\n", __LINE__, message); \
abort(); \
}
#else
#define ASSERT(condition, message) ;
#endif
#endif