Skip to content
Snippets Groups Projects
Commit 4823338d authored by Nadav Har'El's avatar Nadav Har'El
Browse files

Fix memory leaks in mmap/munmap

mmap/munmap and its cousins mmu::map_*() used to leak the 48-byte "vma"
object, twice. The idea to separate reserve() and map() was a good one,
but it was implemented incorrectly causing a vma object to be allocated
twice per mmap, and both of them were leaked when evacuate() didn't free
them.

So switched to a simpler implementation, where the "vma" object is internal
to mmu.cc, and not used by any of the callers; The struct vma is now properly
allocated only once per mmap(), and freed on munmap().
parent 8e73271f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment