diff options
author | Richard Braun <rbraun@sceen.net> | 2016-05-20 20:10:52 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2016-05-20 20:10:52 +0200 |
commit | 1db202eb8406785500f1bc3ceef7868566e416a1 (patch) | |
tree | a7a27c71d957efd8e9e4bcd2cb630089a9d38967 /ddb/db_elf.c | |
parent | 23bda7b9566982d304ff7d51fa1c1ab8da41c99b (diff) | |
download | gnumach-1db202eb8406785500f1bc3ceef7868566e416a1.tar.gz gnumach-1db202eb8406785500f1bc3ceef7868566e416a1.tar.bz2 gnumach-1db202eb8406785500f1bc3ceef7868566e416a1.zip |
vm_map: back allocations with a red-black tree
This change augments VM maps with a gap tree, sorted by gap size, to
use for non-fixed allocations.
* vm/vm_map.c: Include kern/list.h.
(vm_map_entry_gap_cmp_lookup, vm_map_entry_gap_cmp_insert,
vm_map_gap_valid, vm_map_gap_compute, vm_map_gap_insert_single,
vm_map_gap_remove_single, vm_map_gap_update, vm_map_gap_insert,
vm_map_gap_remove, vm_map_find_entry_anywhere): New functions.
(vm_map_setup): Initialize gap tree.
(_vm_map_entry_link): Call vm_map_gap_insert.
(_vm_map_entry_unlink): Call vm_map_gap_remove.
(vm_map_find_entry, vm_map_enter, vm_map_copyout,
vm_map_copyout_page_list, vm_map_copyin): Replace look up loop with
a call to vm_map_find_entry_anywhere. Call vm_map_gap_update and
initialize gap tree where relevant.
(vm_map_copy_insert): Turn macro into an inline function and rewrite.
(vm_map_simplify): Reorder call to vm_map_entry_unlink so that previous
entry is suitable for use with gap management functions.
* vm/vm_map.h: Include kern/list.h.
(struct vm_map_entry): New members `gap_node`, `gap_list`,
`gap_size` and `in_gap_tree`.
(struct vm_map_header): New member `gap_tree`.
Diffstat (limited to 'ddb/db_elf.c')
0 files changed, 0 insertions, 0 deletions