1

use static logger

This commit is contained in:
2022-07-22 23:32:46 +02:00
parent ec09b0e6d2
commit bd95c02a08
24 changed files with 139 additions and 151 deletions

View File

@ -25,7 +25,7 @@ void BumpAllocator::init() {
this->allocations = 0;
this->next = (unsigned char*)heap_start;
log << INFO << "Initialized Bump Allocator" << endl;
log.info() << "Initialized Bump Allocator" << endl;
}
/*****************************************************************************
@ -51,10 +51,10 @@ void* BumpAllocator::alloc(unsigned int req_size) {
/* Hier muess Code eingefuegt werden */
log << DEBUG << "Requested " << hex << req_size << " Bytes" << endl;
log.debug() << "Requested " << hex << req_size << " Bytes" << endl;
if (req_size + (unsigned int)this->next > this->heap_end) {
log << ERROR << " - More memory requested than available :(" << endl;
log.error() << " - More memory requested than available :(" << endl;
return NULL;
}
@ -62,7 +62,7 @@ void* BumpAllocator::alloc(unsigned int req_size) {
this->next = (unsigned char*)((unsigned int)this->next + req_size);
this->allocations = this->allocations + 1;
log << TRACE << " - Allocated " << hex << req_size << " Bytes." << endl;
log.trace() << " - Allocated " << hex << req_size << " Bytes." << endl;
return allocated;
}
@ -73,5 +73,5 @@ void* BumpAllocator::alloc(unsigned int req_size) {
* Beschreibung: Nicht implementiert. *
*****************************************************************************/
void BumpAllocator::free(void* ptr) {
log << ERROR << " mm_free: ptr= " << hex << (unsigned int)ptr << ", not supported" << endl;
log.error() << " mm_free: ptr= " << hex << (unsigned int)ptr << ", not supported" << endl;
}