An I/O controller for virtual pinball machines: accelerometer nudge sensing, analog plunger input, button input encoding, LedWiz compatible output controls, and more.

Dependencies:   mbed FastIO FastPWM USBDevice

Fork of Pinscape_Controller by Mike R

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OpNew.cpp Source File

OpNew.cpp

00001 #include "NewMalloc.h"
00002 
00003 // Overload operator new to call our custom malloc.  This ensures that
00004 // all 'new' allocations throughout the program (including library code)
00005 // go through our private allocator.
00006 void *operator new(size_t siz) { return xmalloc(siz); }
00007 void *operator new[](size_t siz) { return xmalloc(siz); }
00008 
00009 // Since we don't do bookkeeping to track released memory, 'delete' does
00010 // nothing.  In actual testing, this routine appears to never be called.
00011 // If it *is* ever called, it will simply leave the block in place, which
00012 // will make it unavailable for re-use but will otherwise be harmless.
00013 void operator delete(void *ptr) { }