mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-05 05:04:46 +00:00

remove newline from logging statements in code. The LOG_* functions will now magically add it at the end. --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
29 lines
482 B
C++
29 lines
482 B
C++
#include "SimpleAllocator.h"
|
|
#include "assert.h"
|
|
#include "configuration.h"
|
|
|
|
SimpleAllocator::SimpleAllocator()
|
|
{
|
|
reset();
|
|
}
|
|
|
|
void *SimpleAllocator::alloc(size_t size)
|
|
{
|
|
assert(nextFree + size <= sizeof(bytes));
|
|
void *res = &bytes[nextFree];
|
|
nextFree += size;
|
|
LOG_DEBUG("Total simple allocs %u", nextFree);
|
|
|
|
return res;
|
|
}
|
|
|
|
void SimpleAllocator::reset()
|
|
{
|
|
nextFree = 0;
|
|
}
|
|
|
|
void *operator new(size_t size, SimpleAllocator &p)
|
|
{
|
|
return p.alloc(size);
|
|
}
|