Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: nspr/pr/src/misc/prsystem.c

Issue 279293002: [Mac] Release the mach_host_self() Mach port when done with it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/misc/prsystem.c
===================================================================
--- nspr/pr/src/misc/prsystem.c (revision 269863)
+++ nspr/pr/src/misc/prsystem.c (working copy)
@@ -33,6 +33,7 @@
#if defined(DARWIN)
#include <mach/mach_init.h>
#include <mach/mach_host.h>
+#include <mach/mach_port.h>
#endif
#if defined(HPUX)
@@ -297,13 +298,16 @@
#elif defined(DARWIN)
+ mach_port_t mach_host = mach_host_self();
+
struct host_basic_info hInfo;
mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
- int result = host_info(mach_host_self(),
+ int result = host_info(mach_host,
HOST_BASIC_INFO,
(host_info_t) &hInfo,
&count);
+ mach_port_deallocate(mach_task_self(), mach_host);
if (result == KERN_SUCCESS)
bytes = hInfo.max_mem;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698