fix printing of status updates when allocating
This commit is contained in:
@ -149,6 +149,8 @@ void CGA::scrollup() {
|
||||
|
||||
/* Hier muess Code eingefuegt werden */
|
||||
|
||||
// TODO: I really want a scrollback buffer
|
||||
|
||||
// Move up
|
||||
for (unsigned short byte = 2 * COLUMNS * 1; byte < 2 * COLUMNS * ROWS; ++byte) {
|
||||
*((char*)(CGA_START + byte - 2 * COLUMNS * 1)) = *(CGA_START + byte);
|
||||
|
||||
@ -26,9 +26,8 @@ void BumpAllocator::init() {
|
||||
this->next = (unsigned char*)heap_start;
|
||||
|
||||
kout << "Initialized Bump Allocator" << endl
|
||||
<< "Heap Start: " << hex << (unsigned int)this->heap_start
|
||||
<< " - Heap Start: " << hex << (unsigned int)this->heap_start
|
||||
<< ", Heap End: " << hex << (unsigned int)this->heap_end << endl;
|
||||
kout << endl;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -41,9 +40,8 @@ void BumpAllocator::dump_free_memory() {
|
||||
/* Hier muess Code eingefuegt werden */
|
||||
|
||||
kout << "Freier Speicher:" << endl
|
||||
<< "Next: " << hex << (unsigned int)this->next
|
||||
<< " - Next: " << hex << (unsigned int)this->next
|
||||
<< ", Allocations: " << dec << this->allocations << endl;
|
||||
kout << endl;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -58,8 +56,7 @@ void* BumpAllocator::alloc(unsigned int req_size) {
|
||||
kout << "Requested " << hex << req_size << " Bytes" << endl;
|
||||
|
||||
if (req_size + (unsigned int)this->next > this->heap_end) {
|
||||
kout << "More memory requested than available :(" << endl;
|
||||
kout << endl;
|
||||
kout << " - More memory requested than available :(" << endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -67,8 +64,7 @@ void* BumpAllocator::alloc(unsigned int req_size) {
|
||||
this->next = (unsigned char*)((unsigned int)this->next + req_size);
|
||||
this->allocations = this->allocations + 1;
|
||||
|
||||
kout << "Allocated " << hex << req_size << " Bytes." << endl;
|
||||
kout << endl;
|
||||
kout << " - Allocated " << hex << req_size << " Bytes." << endl;
|
||||
|
||||
return allocated;
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ struct free_block* LinkedListAllocator::find_previous_block(struct free_block* n
|
||||
// Durchlaufe die ganze freispeicherliste bis zum Block der auf next_block zeigt
|
||||
struct free_block* current = next_block;
|
||||
while (current->next != next_block) {
|
||||
// NOTE: This can get stuck if called on the wrong block
|
||||
// NOTE: This will get stuck if called on the wrong block
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user