Cache the host port like we cache the task port
commitbb95a72318e747ce8854e161cc590e67ac17f4f9
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Wed, 16 Sep 2015 17:41:14 +0000 (16 19:41 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 16 Sep 2015 17:41:36 +0000 (16 19:41 +0200)
tree2f0b0af6735b1fc4a90f6a4de6951a3afff0b79f
parentc88b3da93e4b6ff1dd8c6192e358aa60b98114dc
Cache the host port like we cache the task port

This way we do not
need to call the kernel just to get the port.  Furthermore, we no
longer increase the reference count on every invocation of
`mach_host_self'.

* mach/mach/mach_traps.h (__mach_host_self, mach_host_self):
Protect declarations against the macro expansion.
* mach/mach_init.c (__mach_host_self_): New variable.
(mach_init): Initialize `__mach_host_self_'.
* mach/mach_init.h (__mach_host_self_): New declaration.
(__mach_host_self, mach_host_self): New macros.
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start_cleanup):
Release reference.
ChangeLog
mach/mach/mach_traps.h
mach/mach_init.c
mach/mach_init.h
sysdeps/mach/hurd/dl-sysdep.c