diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-03-18 12:25:26 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-05-20 11:08:29 +0200 |
commit | 5a00790518773385e681e6430a4f85245fae957d (patch) | |
tree | 739a06f7b8184b06c099d6c364f84f0927ad20aa /ipc/ipc_space.c | |
parent | aac601ac36c623247a51d442b2d6438b042d7515 (diff) | |
download | gnumach-5a00790518773385e681e6430a4f85245fae957d.tar.gz gnumach-5a00790518773385e681e6430a4f85245fae957d.tar.bz2 gnumach-5a00790518773385e681e6430a4f85245fae957d.zip |
ipc: replace reverse hash table with a radix tree
Currently, there is a hash table mapping (space, object) tuples to
`ipc_entry' objects. This hash table is intertwined with the IPC
tables. There is one hash table per IPC space, but it is only for the
entries in the IPC table. This hash table is called `local' in the
source. All IPC entries being spilled into the splay tree are instead
mapped by a global hash table.
Replace the local (i.e. per IPC space) reverse hash table with a radix
tree.
* ipc/ipc_entry.c (ipc_entry_grow_table): Adjust accordingly.
* ipc/ipc_entry.h (struct ipc_entry): Adjust comment.
* ipc/ipc_hash.c: Adjust comment explaining the local lookup table.
(IPC_LOCAL_HASH_INVARIANT): New macro.
(ipc_hash_local_lookup): Use the new `ipc_reverse_lookup' function.
(ipc_hash_local_insert): Use the new `ipc_reverse_insert' function.
(ipc_hash_local_delete): Use the new `ipc_reverse_remove' function.
* ipc/ipc_space.c (ipc_space_create): Initialize radix tree.
(ipc_space_destroy): Free radix tree.
* ipc/ipc_space.h (struct ipc_space): Add radix tree.
(ipc_reverse_insert): New function.
(ipc_reverse_remove): Likewise.
(ipc_reverse_remove_all): Likewise.
(ipc_reverse_lookup): Likewise.
* ipc/ipc_right.c (ipc_right_clean): Update comment.
Diffstat (limited to 'ipc/ipc_space.c')
-rw-r--r-- | ipc/ipc_space.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ipc/ipc_space.c b/ipc/ipc_space.c index ab55e838..dcc96b34 100644 --- a/ipc/ipc_space.c +++ b/ipc/ipc_space.c @@ -148,6 +148,7 @@ ipc_space_create( space->is_tree_total = 0; space->is_tree_small = 0; space->is_tree_hash = 0; + rdxtree_init(&space->is_reverse_map); *spacep = space; return KERN_SUCCESS; @@ -271,6 +272,8 @@ ipc_space_destroy( } ipc_splay_traverse_finish(&space->is_tree); + rdxtree_remove_all(&space->is_reverse_map); + /* * Because the space is now dead, * we must release the "active" reference for it. |