[sgen] Add debug option for valloc limit
[mono-project.git] / mono / utils / mach-support.c
blob4abfcfaa2c6413b4b837c1ceef7472fdf44caa4f
1 /**
2 * \file
3 * mach support for x86
5 * Authors:
6 * Geoff Norton (gnorton@novell.com)
8 * (C) 2010 Ximian, Inc.
9 */
11 #include <config.h>
12 #if defined(__MACH__)
13 #include <glib.h>
14 #include <mach/mach.h>
15 #include <mach/task.h>
16 #include <mach/mach_port.h>
17 #include <mach/thread_act.h>
18 #include <mach/thread_status.h>
20 #include <mono/utils/mono-mmap.h>
22 #include "mach-support.h"
24 kern_return_t
25 mono_mach_get_threads (thread_act_array_t *threads, guint32 *count)
27 kern_return_t ret;
29 do {
30 ret = task_threads (current_task (), threads, count);
31 } while (ret == KERN_ABORTED);
33 return ret;
36 kern_return_t
37 mono_mach_free_threads (thread_act_array_t threads, guint32 count)
39 return vm_deallocate(current_task (), (vm_address_t) threads, sizeof (thread_t) * count);
41 #endif