diff options
| author | 2016-01-27 08:12:00 +0100 | |
|---|---|---|
| committer | 2016-01-27 08:12:00 +0100 | |
| commit | b1d6f6d63f8294a3f62d7db6f9eea07da1d93664 (patch) | |
| tree | 10258b6f255e00e7eec2ec30112d6de07015c475 /src/lib | |
| parent | 9425c141de76ef9ee178af80731110e228fa89bb (diff) | |
Cleanups and version bumpmame0170
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/util/corealloc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 0eab4b5123e..4f0b961eb59 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -35,15 +35,15 @@ template<typename _Tp, typename... _Args> inline _Tp* global_alloc_clear(_Args&&... __args) -{ +{ unsigned char * ptr = new unsigned char[sizeof(_Tp)]; // allocate memory memset(ptr, 0, sizeof(_Tp)); - return new(ptr) _Tp(std::forward<_Args>(__args)...); + return new(ptr) _Tp(std::forward<_Args>(__args)...); } template<typename _Tp> inline _Tp* global_alloc_array_clear(size_t __num) -{ +{ auto size = sizeof(_Tp) * __num; unsigned char* ptr = new unsigned char[size]; // allocate memory memset(ptr, 0, size); |
