少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
 * \file
 * String internal calls for the corlib
 *
 * Author:
 *   Patrik Torstensson (patrik.torstensson@labs2.com)
 *   Duncan Mak  (duncan@ximian.com)
 *
 * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
 * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "mono/utils/mono-membar.h"
#include <mono/metadata/string-icalls.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/object.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/gc-internals.h>
 
/* This function is redirected to String.CreateString ()
   by mono_marshal_get_native_wrapper () */
void
ves_icall_System_String_ctor_RedirectToCreateString (void)
{
    g_assert_not_reached ();
}
 
MonoString *
ves_icall_System_String_InternalAllocateStr (gint32 length)
{
    MonoError error;
    MonoString *str = mono_string_new_size_checked (mono_domain_get (), length, &error);
    mono_error_set_pending_exception (&error);
 
    return str;
}
 
MonoString  *
ves_icall_System_String_InternalIntern (MonoString *str)
{
    MonoError error;
    MonoString *res;
 
    res = mono_string_intern_checked (str, &error);
    if (!res) {
        mono_error_set_pending_exception (&error);
        return NULL;
    }
    return res;
}
 
MonoString * 
ves_icall_System_String_InternalIsInterned (MonoString *str)
{
    return mono_string_is_interned (str);
}
 
int
ves_icall_System_String_GetLOSLimit (void)
{
    int limit = mono_gc_get_los_limit ();
 
    return (limit - 2 - G_STRUCT_OFFSET (MonoString, chars)) / 2;
}