main
gen.c
1#include <stdio.h>
2#include <stdlib.h>
3#include "gen.h"
4#include "mem.h"
5#include "util.h"
6
7void init_code_info(code_info *code)
8{
9 size_t size = CODE_ALLOC_SIZE;
10 code->cur = alloc_code(&size);
11 if (!code->cur) {
12 fatal_error("Failed to allocate memory for generated code\n");
13 }
14 code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS;
15 code->stack_off = 0;
16}