diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-30 03:58:43 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-30 09:15:08 +0200 |
commit | 3a0fae39873c9c7d73dc978888e45b87ad27d44e (patch) | |
tree | 061847ec497d24b684d7c1b14aa2e823295ebaba /ipc/ipc_hash.c | |
parent | 3166fe0edd4a5cf0d690c094f2fd06647ba380e5 (diff) |
ipc: use fast modulo operation in local hash table
* ipc/ipc_table.h: Document that table sizes must be powers of two.
* ipc/ipc_hash.c (IH_LOCAL_HASH): Use fast modulo operation.
Diffstat (limited to 'ipc/ipc_hash.c')
-rw-r--r-- | ipc/ipc_hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/ipc_hash.c b/ipc/ipc_hash.c index 8285717..c2c6d6e 100644 --- a/ipc/ipc_hash.c +++ b/ipc/ipc_hash.c @@ -326,7 +326,7 @@ ipc_hash_global_delete( */ #define IH_LOCAL_HASH(obj, size) \ - ((((mach_port_index_t) (vm_offset_t) (obj)) >> 6) % (size)) + ((((mach_port_index_t) (vm_offset_t) (obj)) >> 6) & (size - 1)) /* * Routine: ipc_hash_local_lookup |