1

add vorgabe03 + initial bump allocator

This commit is contained in:
churl
2022-05-06 11:28:20 +02:00
parent ab7a9c2ecb
commit 4ee0b701d7
17 changed files with 472 additions and 59 deletions

View File

@ -0,0 +1,34 @@
/*****************************************************************************
* *
* B U M P A L L O C A T O R *
* *
*---------------------------------------------------------------------------*
* Beschreibung: Eine sehr einfache Heap-Verwaltung, welche freigegebenen *
* Speicher nicht mehr nutzen kann. *
* *
* Autor: Michael Schoettner, HHU, 3.3.2022 *
*****************************************************************************/
#ifndef __BumpAllocator_include__
#define __BumpAllocator_include__
#include "kernel/Allocator.h"
class BumpAllocator : Allocator {
private:
unsigned char* next;
unsigned int allocations;
BumpAllocator(Allocator& copy); // Verhindere Kopieren
public:
BumpAllocator() {}
void init();
void dump_free_memory();
void* alloc(unsigned int req_size);
void free(void* ptr);
};
#endif