02104: metlhawk, metlhwkj: Crash while decoding with '-debug' trigger

Fixed auto_malloc() along the way to randomize its memory when allocated in
the debug build. This used to be the standard, but it seems to have been removed 
when the pool allocation was moved into the library.
This commit is contained in:
Aaron Giles 2009-01-02 16:55:07 +00:00
parent fc7e4f0f46
commit 74d7495dbc
2 changed files with 8 additions and 2 deletions

View File

@ -199,7 +199,11 @@ void *restrack_register_object(object_type type, void *ptr, size_t size, const c
void *auto_malloc_file_line(size_t size, const char *file, int line)
{
return pool_malloc_file_line(current_pool(), size, file, line);
void *result = pool_malloc_file_line(current_pool(), size, file, line);
#ifdef MAME_DEBUG
rand_memory(result, size);
#endif
return result;
}
@ -273,7 +277,8 @@ bitmap_t *auto_bitmap_alloc_file_line(int width, int height, bitmap_format forma
/*-------------------------------------------------
validate_auto_malloc_memory - validate that a
block of memory has been allocated by auto_malloc()
block of memory has been allocated by
auto_malloc()
-------------------------------------------------*/
void validate_auto_malloc_memory(void *memory, size_t memory_size)

View File

@ -1082,6 +1082,7 @@ roz_get_info( running_machine *machine, tile_data *tileinfo, int tile_index, int
if( tile&0x0200 ) mangle |= 0x0400;
if( tile&0x0400 ) mangle |= 0x0800;
if( tile&0x0800 ) mangle |= 0x1000;
tile &= 0x3fff; /* cap mask offset */
break;
default: