mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
corealloc adjustments:
- re-enabled default memory initialization in DEBUG builds (should make random crashes less random) - moved defines from header to source since they are only used locally and not globally - added file/line information to global_free* and fixed src/emu/sound/spu.c compilation
This commit is contained in:
parent
175dedacfc
commit
36ad612f60
@ -319,7 +319,7 @@ public:
|
||||
if (ref_count==0)
|
||||
{
|
||||
cache_size-=(dend-data)<<1;
|
||||
global_free(this);
|
||||
global_free(const_cast<sample_cache*>(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,14 @@
|
||||
|
||||
#define LOG_ALLOCS (0)
|
||||
|
||||
// define this to initialize allocated memory to a fixed non-0 value
|
||||
#ifdef MAME_DEBUG
|
||||
#define INITIALIZE_ALLOCATED_MEMORY
|
||||
#endif
|
||||
|
||||
// define this to zap memory to a fixed non-0 value before freeing
|
||||
//#define OVERWRITE_FREED_MEMORY
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
|
@ -18,18 +18,6 @@
|
||||
#include "osdcore.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEBUGGING
|
||||
//**************************************************************************
|
||||
|
||||
// define this to initialize allocated memory to a fixed non-0 value
|
||||
//#define INITIALIZE_ALLOCATED_MEMORY
|
||||
|
||||
// define this to zap memory to a fixed non-0 value before freeing
|
||||
//#define OVERWRITE_FREED_MEMORY
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS
|
||||
//**************************************************************************
|
||||
@ -39,8 +27,8 @@
|
||||
#define global_alloc_clear(_type) new(__FILE__, __LINE__, zeromem) _type
|
||||
#define global_alloc_array(_type, _num) new(__FILE__, __LINE__) _type[_num]
|
||||
#define global_alloc_array_clear(_type, _num) new(__FILE__, __LINE__, zeromem) _type[_num]
|
||||
#define global_free(_ptr) do { delete _ptr; } while (0)
|
||||
#define global_free_array(_ptr) do { delete[] _ptr; } while (0)
|
||||
#define global_free(_ptr) do { operator delete(_ptr, __FILE__, __LINE__); } while (0)
|
||||
#define global_free_array(_ptr) do { operator delete[](_ptr, __FILE__, __LINE__); } while (0)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user