diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-12-02 12:43:24 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-12-02 12:43:24 +0000 |
| commit | f7abde02150deacbc2ad1957e6165769cc2fea0b (patch) | |
| tree | 29d7ddd69fc60d08c1f897a4178b0d9d1d962dfa /arch | |
| parent | 37de7b3b395a4b9cdf46a8b20ce6bb6a7d481354 (diff) | |
| download | teachos-f7abde02150deacbc2ad1957e6165769cc2fea0b.tar.xz teachos-f7abde02150deacbc2ad1957e6165769cc2fea0b.zip | |
Add comment on extra double deallocation check
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp index e8ecc30..6af6298 100644 --- a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp +++ b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp @@ -74,6 +74,9 @@ namespace teachos::arch::memory::heap * increases by the amount in the current memory block header. After reading it we also clear the header. * 4. If the previous block is adjacent the size of the previous block simply increases to include the given size as * well. + * 5. If the previous block is directly in our start address, so they overlap then it has to mean some or all of the + * region we are trying to deallocate has been freed before. Which would result in a double free therefore we halt + * the execution of the program. * * @param previous_block Free memory block before the block to deallocate in our heap memory. * @param current_block Free memory block after the block to deallocate in our heap memory. |
