Pass the --clr-memory-model flag on the command line instead of MONO_DEBUG so its...
[mono-project.git] / mono / metadata / string-icalls.c
blob045b94a9e917a33909a40ac5ab016bd4204746b7
1 /**
2 * \file
3 * String internal calls for the corlib
5 * Author:
6 * Patrik Torstensson (patrik.torstensson@labs2.com)
7 * Duncan Mak (duncan@ximian.com)
9 * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
10 * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
11 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
13 #include <config.h>
14 #include <stdlib.h>
15 #include <stdio.h>
16 #include <string.h>
17 #include "mono/utils/mono-membar.h"
18 #include <mono/metadata/string-icalls.h>
19 #include <mono/metadata/class-internals.h>
20 #include <mono/metadata/appdomain.h>
21 #include <mono/metadata/tabledefs.h>
22 #include <mono/metadata/loader.h>
23 #include <mono/metadata/object.h>
24 #include <mono/metadata/exception.h>
25 #include <mono/metadata/debug-helpers.h>
26 #include <mono/metadata/gc-internals.h>
27 #include "icall-decl.h"
29 /* This function is redirected to String.CreateString ()
30 by mono_marshal_get_native_wrapper () */
31 void
32 ves_icall_System_String_ctor_RedirectToCreateString (void)
34 g_assert_not_reached ();
37 MonoStringHandle
38 ves_icall_System_String_InternalAllocateStr (gint32 length, MonoError *error)
40 return mono_string_new_size_handle (mono_domain_get (), length, error);
43 MonoStringHandle
44 ves_icall_System_String_InternalIntern (MonoStringHandle str, MonoError *error)
46 return mono_string_intern_checked (str, error);
49 MonoStringHandle
50 ves_icall_System_String_InternalIsInterned (MonoStringHandle str, MonoError *error)
52 return mono_string_is_interned_internal (str, error);
55 int
56 ves_icall_System_String_GetLOSLimit (void)
58 int limit = mono_gc_get_los_limit ();
60 return (limit - 2 - G_STRUCT_OFFSET (MonoString, chars)) / 2;