view gen.c @ 589:2dde38c1744f

Split gen_mem_fun out of m68k_core_x86 and make it more generic so it can be used by the Z80 core
author Michael Pavone <pavone@retrodev.com>
date Tue, 11 Mar 2014 09:44:47 -0700
parents c8fefa140c80
children 724bbec47f86
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include "gen.h"
#include "mem.h"

void init_code_info(code_info *code)
{
	size_t size = CODE_ALLOC_SIZE;
	code->cur = alloc_code(&size);
	if (!code->cur) {
		fputs("Failed to allocate memory for generated code\n", stderr);
		exit(1);
	}
	code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS;
}