summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/netlist/plib/palloc.c
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-07-20 08:11:41 +0200
committer ImJezze <jezze@gmx.net>2015-07-20 08:11:41 +0200
commit4bcb0c13f50ddb1cd3fd0341b4bb31d9c3c7fc7a (patch)
tree55eccacfca0e69435d0d4e6615205310ca11f271 /src/emu/netlist/plib/palloc.c
parentd132946c6f45aa8d271c6180e86f72dd08243048 (diff)
parent229785f695b26c702c8490792611f59d0366a933 (diff)
Merge pull request #5 from mamedev/master
Sync to base master
Diffstat (limited to 'src/emu/netlist/plib/palloc.c')
-rw-r--r--src/emu/netlist/plib/palloc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/emu/netlist/plib/palloc.c b/src/emu/netlist/plib/palloc.c
index 5f9dbc5fee7..2ed54bd0b35 100644
--- a/src/emu/netlist/plib/palloc.c
+++ b/src/emu/netlist/plib/palloc.c
@@ -6,11 +6,35 @@
*/
#include "pconfig.h"
+#include "palloc.h"
#if (PSTANDALONE)
#include <stdlib.h>
#include <xmmintrin.h>
+class pmemory_pool
+{
+public:
+ pmemory_pool() {}
+};
+
+static pmemory_pool sppool;
+
+pmemory_pool *ppool = &sppool;
+
+void* operator new(std::size_t size, pmemory_pool *pool) throw (std::bad_alloc)
+{
+ //printf("here new\n");
+ return palloc_raw(size);;
+}
+
+void operator delete(void *ptr, pmemory_pool *pool)
+{
+ //printf("here delete\n");
+ if (ptr != NULL)
+ pfree_raw(ptr);
+}
+
void *palloc_raw(const size_t size)
{
return _mm_malloc(size, 64);