Skip to content

Commit 8e62596

Browse files
byroottenderlove
authored andcommitted
Move some defines from shape.h to shape.c
If they are only used there, we might as well not expose them.
1 parent 719b40b commit 8e62596

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

shape.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@
1919
#define SHAPE_DEBUG (VM_CHECK_MODE > 0)
2020
#endif
2121

22+
#if SIZEOF_SHAPE_T == 4
23+
#define SHAPE_BUFFER_SIZE 0x80000
24+
#else
25+
#define SHAPE_BUFFER_SIZE 0x8000
26+
#endif
27+
2228
#define SINGLE_CHILD_TAG 0x1
2329
#define TAG_SINGLE_CHILD(x) (struct rb_id_table *)((uintptr_t)x | SINGLE_CHILD_TAG)
2430
#define SINGLE_CHILD_MASK (~((uintptr_t)SINGLE_CHILD_TAG))
2531
#define SINGLE_CHILD_P(x) (((uintptr_t)x) & SINGLE_CHILD_TAG)
2632
#define SINGLE_CHILD(x) (rb_shape_t *)((uintptr_t)x & SINGLE_CHILD_MASK)
2733
#define ANCESTOR_CACHE_THRESHOLD 10
34+
#define MAX_SHAPE_ID (SHAPE_BUFFER_SIZE - 1)
2835

2936
static ID id_frozen;
3037
static ID id_t_object;

shape.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ typedef uint32_t attr_index_t;
1111
typedef uint32_t shape_id_t;
1212
typedef uint32_t redblack_id_t;
1313
# define SHAPE_ID_NUM_BITS 32
14-
# define SHAPE_BUFFER_SIZE 0x80000
1514

1615
#else
1716

@@ -21,7 +20,6 @@ typedef uint16_t attr_index_t;
2120
typedef uint16_t shape_id_t;
2221
typedef uint16_t redblack_id_t;
2322
# define SHAPE_ID_NUM_BITS 16
24-
# define SHAPE_BUFFER_SIZE 0x8000
2523

2624
#endif
2725

@@ -34,7 +32,6 @@ typedef uint16_t redblack_id_t;
3432

3533
# define SHAPE_MAX_VARIATIONS 8
3634

37-
# define MAX_SHAPE_ID (SHAPE_BUFFER_SIZE - 1)
3835
# define INVALID_SHAPE_ID SHAPE_MASK
3936
# define ROOT_SHAPE_ID 0x0
4037

0 commit comments

Comments
 (0)