diff m68k_core.c @ 1783:eda8df5bc74c

Minor cleanup
author Michael Pavone <pavone@retrodev.com>
date Mon, 11 Mar 2019 00:04:48 -0700
parents 24508cb54f87
children 0c6d07f91346 c157a535ceeb
line wrap: on
line diff
--- a/m68k_core.c	Sun Mar 10 23:10:43 2019 -0700
+++ b/m68k_core.c	Mon Mar 11 00:04:48 2019 -0700
@@ -1216,9 +1216,7 @@
 
 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler)
 {
-	size_t ctx_size = sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8;
-	m68k_context * context = malloc(ctx_size);
-	memset(context, 0, ctx_size);
+	m68k_context * context = calloc(1, sizeof(m68k_context) + ram_size(&opts->gen) / (1 << opts->gen.ram_flags_shift) / 8);
 	context->options = opts;
 	context->int_cycle = CYCLE_NEVER;
 	context->status = 0x27;