Stop LeakSanitizer complaining about Uxn's RAM.

This commit is contained in:
Andrew Alderwick 2022-01-05 18:18:13 +00:00
parent 9024963de1
commit f48a09c482
2 changed files with 7 additions and 2 deletions

View File

@ -133,13 +133,16 @@ load(Uxn *u, char *filepath)
return 1;
}
static Uint8 *memory;
int
main(int argc, char **argv)
{
Uxn u;
int i, loaded = 0;
if(!uxn_boot(&u, (Uint8 *)calloc(0xffff, sizeof(Uint8))))
memory = (Uint8 *)calloc(0xffff, sizeof(Uint8));
if(!uxn_boot(&u, memory))
return error("Boot", "Failed");
/* system */ devsystem = uxn_port(&u, 0x0, system_dei, system_deo);

View File

@ -271,10 +271,12 @@ load(Uxn *u, char *rom)
return 1;
}
static Uint8 *memory;
static int
start(Uxn *u, char *rom)
{
Uint8 *memory = (Uint8 *)calloc(0xffff, sizeof(Uint8));
memory = (Uint8 *)calloc(0xffff, sizeof(Uint8));
if(!uxn_boot(u, memory))
return error("Boot", "Failed to start uxn.");
if(!load(u, rom))