Mirror with some correction

Dependencies:   mbed FastIO FastPWM USBDevice

Committer:
mjr
Date:
Thu Mar 23 05:19:05 2017 +0000
Revision:
79:682ae3171a08
FTFA/Ticker issue fixed (by removing Ticker, changing to Timeout); new "flash write succeeded" status flag; optical plunger rounding improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mjr 79:682ae3171a08 1 #include "NewMalloc.h"
mjr 79:682ae3171a08 2
mjr 79:682ae3171a08 3 // Overload operator new to call our custom malloc. This ensures that
mjr 79:682ae3171a08 4 // all 'new' allocations throughout the program (including library code)
mjr 79:682ae3171a08 5 // go through our private allocator.
mjr 79:682ae3171a08 6 void *operator new(size_t siz) { return xmalloc(siz); }
mjr 79:682ae3171a08 7 void *operator new[](size_t siz) { return xmalloc(siz); }
mjr 79:682ae3171a08 8
mjr 79:682ae3171a08 9 // Since we don't do bookkeeping to track released memory, 'delete' does
mjr 79:682ae3171a08 10 // nothing. In actual testing, this routine appears to never be called.
mjr 79:682ae3171a08 11 // If it *is* ever called, it will simply leave the block in place, which
mjr 79:682ae3171a08 12 // will make it unavailable for re-use but will otherwise be harmless.
mjr 79:682ae3171a08 13 void operator delete(void *ptr) { }