diff options
author | Mike Pall <mike> | 2014-12-20 00:17:50 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2014-12-20 00:17:50 +0100 |
commit | 6e9145a882ea70fe438d59959ac4e65481fe5e85 (patch) | |
tree | 98e7c78e5aab6bd0360d9e00e4c82e9f1634c96d /src/lj_def.h | |
parent | 82e6e5fb5f17e497b3341322998ede75ec29e554 (diff) | |
download | luajit-6e9145a882ea70fe438d59959ac4e65481fe5e85.tar.gz luajit-6e9145a882ea70fe438d59959ac4e65481fe5e85.tar.bz2 luajit-6e9145a882ea70fe438d59959ac4e65481fe5e85.zip |
Cleanup of memory vs. GC sizes. No functional changes.
Diffstat (limited to 'src/lj_def.h')
-rw-r--r-- | src/lj_def.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lj_def.h b/src/lj_def.h index 8624aed2..93420ba5 100644 --- a/src/lj_def.h +++ b/src/lj_def.h | |||
@@ -46,10 +46,12 @@ typedef unsigned int uintptr_t; | |||
46 | #include <stdlib.h> | 46 | #include <stdlib.h> |
47 | 47 | ||
48 | /* Various VM limits. */ | 48 | /* Various VM limits. */ |
49 | #define LJ_MAX_MEM 0x7fffff00 /* Max. total memory allocation. */ | 49 | #define LJ_MAX_MEM32 0x7fffff00 /* Max. 32 bit memory allocation. */ |
50 | #define LJ_MAX_MEM LJ_MAX_MEM32 /* Max. total memory allocation. */ | ||
50 | #define LJ_MAX_ALLOC LJ_MAX_MEM /* Max. individual allocation length. */ | 51 | #define LJ_MAX_ALLOC LJ_MAX_MEM /* Max. individual allocation length. */ |
51 | #define LJ_MAX_STR LJ_MAX_MEM /* Max. string length. */ | 52 | #define LJ_MAX_STR LJ_MAX_MEM32 /* Max. string length. */ |
52 | #define LJ_MAX_UDATA LJ_MAX_MEM /* Max. userdata length. */ | 53 | #define LJ_MAX_BUF LJ_MAX_MEM32 /* Max. buffer length. */ |
54 | #define LJ_MAX_UDATA LJ_MAX_MEM32 /* Max. userdata length. */ | ||
53 | 55 | ||
54 | #define LJ_MAX_STRTAB (1<<26) /* Max. string table size. */ | 56 | #define LJ_MAX_STRTAB (1<<26) /* Max. string table size. */ |
55 | #define LJ_MAX_HBITS 26 /* Max. hash bits. */ | 57 | #define LJ_MAX_HBITS 26 /* Max. hash bits. */ |
@@ -57,7 +59,7 @@ typedef unsigned int uintptr_t; | |||
57 | #define LJ_MAX_ASIZE ((1<<(LJ_MAX_ABITS-1))+1) /* Max. array part size. */ | 59 | #define LJ_MAX_ASIZE ((1<<(LJ_MAX_ABITS-1))+1) /* Max. array part size. */ |
58 | #define LJ_MAX_COLOSIZE 16 /* Max. elems for colocated array. */ | 60 | #define LJ_MAX_COLOSIZE 16 /* Max. elems for colocated array. */ |
59 | 61 | ||
60 | #define LJ_MAX_LINE LJ_MAX_MEM /* Max. source code line number. */ | 62 | #define LJ_MAX_LINE LJ_MAX_MEM32 /* Max. source code line number. */ |
61 | #define LJ_MAX_XLEVEL 200 /* Max. syntactic nesting level. */ | 63 | #define LJ_MAX_XLEVEL 200 /* Max. syntactic nesting level. */ |
62 | #define LJ_MAX_BCINS (1<<26) /* Max. # of bytecode instructions. */ | 64 | #define LJ_MAX_BCINS (1<<26) /* Max. # of bytecode instructions. */ |
63 | #define LJ_MAX_SLOTS 250 /* Max. # of slots in a Lua func. */ | 65 | #define LJ_MAX_SLOTS 250 /* Max. # of slots in a Lua func. */ |
@@ -99,6 +101,7 @@ typedef unsigned int uintptr_t; | |||
99 | #define checki32(x) ((x) == (int32_t)(x)) | 101 | #define checki32(x) ((x) == (int32_t)(x)) |
100 | #define checku32(x) ((x) == (uint32_t)(x)) | 102 | #define checku32(x) ((x) == (uint32_t)(x)) |
101 | #define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) | 103 | #define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) |
104 | #define checkptrGC(x) (checkptr32(x)) | ||
102 | 105 | ||
103 | /* Every half-decent C compiler transforms this into a rotate instruction. */ | 106 | /* Every half-decent C compiler transforms this into a rotate instruction. */ |
104 | #define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1)))) | 107 | #define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1)))) |