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

37
c_os/user/HeapDemo.cc Normal file
View File

@ -0,0 +1,37 @@
/*****************************************************************************
* *
* H E A P D E M O *
* *
*---------------------------------------------------------------------------*
* Beschreibung: Demonstration der dynamischen Speicherverwaltung. *
* *
* Autor: Michael Schoettner, HHU, 27.12.2016 *
*****************************************************************************/
#include "user/HeapDemo.h"
#include "kernel/Allocator.h"
#include "kernel/Globals.h"
#include "user/MyObj.h"
// Hilfsfunktion: Auf Return-Taste warten
void waitForReturn() {
/* hier muss Code eingefuegt werden */
Key key;
do {
kb.key_hit();
} while (key.ascii() != '\n');
}
void heap_demo() {
/* hier muss Code eingefuegt werden */
allocator.dump_free_memory();
MyObj* a = new MyObj(5);
allocator.dump_free_memory();
MyObj* b = new MyObj(10);
allocator.dump_free_memory();
}