This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-250-gbb95a72


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  bb95a72318e747ce8854e161cc590e67ac17f4f9 (commit)
      from  c88b3da93e4b6ff1dd8c6192e358aa60b98114dc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bb95a72318e747ce8854e161cc590e67ac17f4f9

commit bb95a72318e747ce8854e161cc590e67ac17f4f9
Author: Justus Winter <4winter@informatik.uni-hamburg.de>
Date:   Wed Sep 16 19:41:14 2015 +0200

    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.

diff --git a/ChangeLog b/ChangeLog
index 32ec6f9..e9cc796 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-09-16  Justus Winter  <4winter@informatik.uni-hamburg.de>
+
+	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.
+
 2015-09-16  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #4404]
diff --git a/mach/mach/mach_traps.h b/mach/mach/mach_traps.h
index 53ec21e..c778caa 100644
--- a/mach/mach/mach_traps.h
+++ b/mach/mach/mach_traps.h
@@ -41,9 +41,10 @@ extern mach_port_t __mach_thread_self (void);
 extern mach_port_t (mach_task_self) (void);
 extern mach_port_t (__mach_task_self) (void);
 
-/* Return the host information port for the host of the calling task.  */
-extern mach_port_t mach_host_self (void);
-extern mach_port_t __mach_host_self (void);
+/* Return the host information port for the host of the calling task.
+   The parens are needed to protect against the macro in <mach_init.h>.  */
+extern mach_port_t (mach_host_self) (void);
+extern mach_port_t (__mach_host_self) (void);
 
 /* Attempt to context switch the current thread off the processor.  Returns
    true if there are other threads that can be run and false if not.  */
diff --git a/mach/mach_init.c b/mach/mach_init.c
index cf8ac3b..8acb71f 100644
--- a/mach/mach_init.c
+++ b/mach/mach_init.c
@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 mach_port_t __mach_task_self_;
+mach_port_t __mach_host_self_;
 vm_size_t __vm_page_size = 0;	/* Must be data not bss for weak alias.  */
 weak_alias (__vm_page_size, vm_page_size)
 
@@ -34,6 +35,7 @@ __mach_init (void)
   kern_return_t err;
 
   __mach_task_self_ = (__mach_task_self) ();
+  __mach_host_self_ = (__mach_host_self) ();
   __mig_init (0);
 
 #ifdef HAVE_HOST_PAGE_SIZE
diff --git a/mach/mach_init.h b/mach/mach_init.h
index 44a7ce2..26b2639 100644
--- a/mach/mach_init.h
+++ b/mach/mach_init.h
@@ -31,6 +31,11 @@ extern mach_port_t __mach_task_self_;
 #define __mach_task_self()	(__mach_task_self_ + 0)	/* Not an lvalue.  */
 #define mach_task_self()	(__mach_task_self ())
 
+/* This cache is initialized at startup.  */
+extern mach_port_t __mach_host_self_;
+#define __mach_host_self()	(__mach_host_self_ + 0)	/* Not an lvalue.  */
+#define mach_host_self()	(__mach_host_self ())
+
 /* Kernel page size.  */
 extern vm_size_t __vm_page_size;
 extern vm_size_t vm_page_size;
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_);
 }
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |   16 ++++++++++++++++
 mach/mach/mach_traps.h        |    7 ++++---
 mach/mach_init.c              |    2 ++
 mach/mach_init.h              |    5 +++++
 sysdeps/mach/hurd/dl-sysdep.c |    1 +
 5 files changed, 28 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]