I am writing an OS for learning purpose
I have an issue when making an assignment in C++. The code is below
In the assignment "entry->next = prev->next;". It does not work, entry->next keep the old value. Here is the source code https://github.com/nguyenzung/kos/blob/ ... anager.cppvoid* MemoryManager::makeMemoryEntry(void* prevAddress, uint16 size) {
Printer::printlnAddress((uint64)this);
MemoryEntry *prev = (MemoryEntry*)prevAddress;
MemoryEntry *entry;
void* entryAddress = prevAddress + sizeof(MemoryEntry) + prev->size;
entry = (MemoryEntry*)entryAddress;
entry->size = size;
entry->next = prev->next;
if (entry->next != prev->next) {
Printer::println("W T F",5);
}
uint64 *next = (uint64*)entryAddress;
prev->next = entry;
return entry;
}
Many thanks