Add some sanity checks for allocator in 64 bit mode.

This commit is contained in:
Mike Pall
2010-01-18 01:32:33 +01:00
parent 32969abe40
commit 4e39597ba6
4 changed files with 8 additions and 1 deletions

View File

@@ -89,6 +89,7 @@ typedef unsigned __int32 uintptr_t;
#define checku8(x) ((x) == (int32_t)(uint8_t)(x))
#define checki16(x) ((x) == (int32_t)(int16_t)(x))
#define checku16(x) ((x) == (int32_t)(uint16_t)(x))
#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
/* Every half-decent C compiler transforms this into a rotate instruction. */
#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(32-(n))))