From bb95a72318e747ce8854e161cc590e67ac17f4f9 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 16 Sep 2015 19:41:14 +0200 Subject: 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. --- sysdeps/mach/hurd/dl-sysdep.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps') diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 8bb9fad..317605b 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -279,6 +279,7 @@ _dl_sysdep_start_cleanup (void) __mach_init. We are done with them now, and the user will reacquire them for himself when he wants them. */ __mig_dealloc_reply_port (MACH_PORT_NULL); + __mach_port_deallocate (__mach_task_self (), __mach_host_self_); __mach_port_deallocate (__mach_task_self (), __mach_task_self_); } -- cgit v1.1