Skip to content

Commit 0fb80c3

Browse files
committed
py: Compress a little the bytecode emitter structure.
1 parent 9597771 commit 0fb80c3

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

py/emitbc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
#define DUMMY_DATA_SIZE (BYTES_FOR_INT)
4949

5050
struct _emit_t {
51-
pass_kind_t pass;
51+
pass_kind_t pass : 8;
52+
uint last_emit_was_return_value : 8;
53+
byte dummy_data[DUMMY_DATA_SIZE];
54+
5255
int stack_size;
53-
bool last_emit_was_return_value;
5456

5557
scope_t *scope;
5658

@@ -65,7 +67,6 @@ struct _emit_t {
6567
uint bytecode_offset;
6668
uint bytecode_size;
6769
byte *code_base; // stores both byte code and code info
68-
byte dummy_data[DUMMY_DATA_SIZE];
6970
};
7071

7172
STATIC void emit_bc_rot_two(emit_t *emit);

py/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ STATIC machine_uint_t gc_lock_depth;
113113
void gc_init(void *start, void *end) {
114114
// align end pointer on block boundary
115115
end = (void*)((machine_uint_t)end & (~(BYTES_PER_BLOCK - 1)));
116-
DEBUG_printf("Initializing GC heap: %p..%p = %ld bytes\n", start, end, end - start);
116+
DEBUG_printf("Initializing GC heap: %p..%p = " UINT_FMT " bytes\n", start, end, end - start);
117117

118118
// calculate parameters for GC (T=total, A=alloc table, F=finaliser table, P=pool; all in bytes):
119119
// T = A + F + P

0 commit comments

Comments
 (0)