You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
720 B
C

#ifdef __LP64__
#define DTABLE_OFFSET 64
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#elif defined(_WIN64)
// long is 32 bits on Win64, so struct objc_class is smaller. All other offsets are the same.
#define DTABLE_OFFSET 56
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#else
#define DTABLE_OFFSET 32
#define SMALLOBJ_BITS 1
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#endif
#define SMALLOBJ_MASK ((1<<SMALLOBJ_BITS) - 1)
// Page size configuration
#if defined(__powerpc64__)
# define PAGE_SHIFT 16
#else
# define PAGE_SHIFT 12
#endif
#define PAGE_SIZE (1<<PAGE_SHIFT)