2 * gc-internal-agnostic.h: Mono-agnostic GC interface.
4 * Copyright (C) 2015 Xamarin Inc
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License 2.0 as published by the Free Software Foundation;
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License 2.0 along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __MONO_METADATA_GCINTERNALAGNOSTIC_H__
21 #define __MONO_METADATA_GCINTERNALAGNOSTIC_H__
27 #include "mono/utils/mono-compiler.h"
28 #include "mono/utils/parse.h"
29 #include "mono/utils/memfuncs.h"
34 guint64 minor_gc_time;
35 guint64 major_gc_time;
36 guint64 major_gc_time_concurrent;
39 extern GCStats gc_stats;
42 * Try to register a foreign thread with the GC, if we fail or the backend
43 * can't cope with this concept - we return FALSE.
45 extern gboolean mono_gc_register_thread (void *baseptr);
47 gboolean mono_gc_parse_environment_string_extract_number (const char *str, size_t *out);
49 void* mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size);
50 void* mono_gc_make_descr_for_array (int vector, gsize *elem_bitmap, int numbits, size_t elem_size);
52 /* simple interface for data structures needed in the runtime */
53 void* mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits);
55 /* Return a root descriptor for a root with all refs */
56 void* mono_gc_make_root_descr_all_refs (int numbits);
58 /* Return the bitmap encoded by a descriptor */
59 gsize* mono_gc_get_bitmap_for_descr (void *descr, int *numbits);
62 These functions must be used when it's possible that either destination is not
63 word aligned or size is not a multiple of word size.
65 void mono_gc_bzero_atomic (void *dest, size_t size);
66 void mono_gc_bzero_aligned (void *dest, size_t size);
67 void mono_gc_memmove_atomic (void *dest, const void *src, size_t size);
68 void mono_gc_memmove_aligned (void *dest, const void *src, size_t size);
70 FILE *mono_gc_get_logfile (void);