diff options
author | 2014-05-15 19:06:32 +0000 | |
---|---|---|
committer | 2014-05-15 19:06:32 +0000 | |
commit | 4762e3a38ffc56df3f6e224d4ea79419b4dd0b67 (patch) | |
tree | 74e882e7c8ac99f2d34a23d996717060ae602491 /src | |
parent | d976c005d7c4062c85c1458a78aba9466fe49062 (diff) |
Revert of r30457 per Micko (nw)
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/sound/spu.c | 2 | ||||
-rw-r--r-- | src/lib/util/corealloc.c | 8 | ||||
-rw-r--r-- | src/lib/util/corealloc.h | 16 |
3 files changed, 15 insertions, 11 deletions
diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c index b22f0d61b48..f6ee4e95a49 100644 --- a/src/emu/sound/spu.c +++ b/src/emu/sound/spu.c @@ -319,7 +319,7 @@ public: if (ref_count==0) { cache_size-=(dend-data)<<1; - global_free(const_cast<sample_cache*>(this)); + global_free(this); } } diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c index 2d1c70d68d9..c1bc9185def 100644 --- a/src/lib/util/corealloc.c +++ b/src/lib/util/corealloc.c @@ -18,14 +18,6 @@ #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 - //************************************************************************** diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 21bf093c3f4..d3982ea3d86 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -19,6 +19,18 @@ //************************************************************************** +// 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 //************************************************************************** @@ -27,8 +39,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 { operator delete(_ptr, __FILE__, __LINE__); } while (0) -#define global_free_array(_ptr) do { operator delete[](_ptr, __FILE__, __LINE__); } while (0) +#define global_free(_ptr) do { delete _ptr; } while (0) +#define global_free_array(_ptr) do { delete[] _ptr; } while (0) |