Skip to content

Commit 90b1f0e

Browse files
committed
Clarify that the VMA allocator stores the VMAs in a few different forms.
Signed-off-by: Amy Ringo <me@remexre.com>
1 parent 0154f59 commit 90b1f0e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/kernel/mm/virtual_alloc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ enum which_treap {
2424
};
2525

2626
/**
27-
* An instance of the virtual memory allocator. The allocator stores a
28-
* non-empty sequence of VMAs, in a few forms.
27+
* An instance of the virtual memory allocator. The allocator stores the same
28+
* non-empty sequence of VMAs in three different data structures.
2929
*
30-
* - All VMAs are stored in an intrusive doubly linked list, sorted by their
31-
* start address. This gives VMAs easy access to their siblings, letting them
32-
* be merged when freed.
33-
* - All VMAs are stored in a treap, sorted by their start address. This allows
34-
* efficiently finding a VMA by address.
35-
* - All free VMAs are stored in a treap, sorted by their size. This allows
36-
* efficiently allocating a free VMA.
30+
* 1. All VMAs are stored in an intrusive doubly linked list, sorted by their
31+
* start address. This gives VMAs easy access to their siblings, letting them
32+
* be merged when freed.
33+
* 2. All VMAs are stored in a treap, sorted by their start address. This allows
34+
* efficiently finding a VMA by address.
35+
* 3. All *free* VMAs are stored in a treap, sorted by their size. This allows
36+
* efficiently allocating a free VMA.
3737
*
3838
* A few invariants hold:
3939
*

0 commit comments

Comments
 (0)