diff options
author | Rodrigo Kumpera <kumpera@gmail.com> | 2016-01-26 23:15:12 +0300 |
---|---|---|
committer | Rodrigo Kumpera <kumpera@gmail.com> | 2016-01-26 23:15:12 +0300 |
commit | a8b276ed8c76125cdd282bb5bdefe89d3a51f579 (patch) | |
tree | e5c133f3020af86b626b636fff5786319aa8743d | |
parent | a3c7b1967934a623a416ef24d526d816dd46e248 (diff) | |
parent | 13c1a05d197f017f0e13a55da19a30a26fefb500 (diff) |
Merge pull request #2500 from ludovic-henry/monoerror-mono_string_alloc
[runtime] Use MonoError for mono_string_alloc
-rw-r--r-- | mono/metadata/boehm-gc.c | 2 | ||||
-rw-r--r-- | mono/metadata/gc-internals.h | 3 | ||||
-rw-r--r-- | mono/metadata/object.c | 8 | ||||
-rw-r--r-- | mono/metadata/sgen-mono.c | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index d26a8c2e9aa..c13e015c3b1 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -1068,7 +1068,7 @@ create_allocator (int atype, int tls_key, gboolean slowpath) always_slowpath: if (atype == ATYPE_STRING) { mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_icall (mb, mono_string_alloc); + mono_mb_emit_icall (mb, ves_icall_string_alloc); } else { mono_mb_emit_ldarg (mb, 0); mono_mb_emit_icall (mb, ves_icall_object_new_specific); diff --git a/mono/metadata/gc-internals.h b/mono/metadata/gc-internals.h index 25cb5014e69..d1ea830bd9d 100644 --- a/mono/metadata/gc-internals.h +++ b/mono/metadata/gc-internals.h @@ -206,7 +206,8 @@ MonoMethod* mono_gc_get_write_barrier (void); void mono_gc_wbarrier_value_copy_bitmap (gpointer dest, gpointer src, int size, unsigned bitmap); /* helper for the managed alloc support */ -MonoString *mono_string_alloc (int length); +MonoString * +ves_icall_string_alloc (int length); /* * Functions supplied by the runtime and called by the GC. Currently only used diff --git a/mono/metadata/object.c b/mono/metadata/object.c index a014b7f76f4..ffae02f394e 100644 --- a/mono/metadata/object.c +++ b/mono/metadata/object.c @@ -960,13 +960,11 @@ mono_class_insecure_overlapping (MonoClass *klass) #endif MonoString* -mono_string_alloc (int length) +ves_icall_string_alloc (int length) { - MONO_REQ_GC_UNSAFE_MODE; - MonoError error; MonoString *str = mono_string_new_size_checked (mono_domain_get (), length, &error); - mono_error_raise_exception (&error); /* FIXME don't raise here */ + mono_error_raise_exception (&error); return str; } @@ -985,7 +983,7 @@ mono_class_compute_gc_descriptor (MonoClass *klass) mono_loader_lock (); mono_register_jit_icall (ves_icall_object_new_fast, "ves_icall_object_new_fast", mono_create_icall_signature ("object ptr"), FALSE); - mono_register_jit_icall (mono_string_alloc, "mono_string_alloc", mono_create_icall_signature ("object int"), FALSE); + mono_register_jit_icall (ves_icall_string_alloc, "ves_icall_string_alloc", mono_create_icall_signature ("object int"), FALSE); gcj_inited = TRUE; mono_loader_unlock (); diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index 9c2e848febf..28a36f76152 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -1117,7 +1117,7 @@ create_allocator (int atype, gboolean slowpath) break; case ATYPE_STRING: mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_icall (mb, mono_string_alloc); + mono_mb_emit_icall (mb, ves_icall_string_alloc); break; default: g_assert_not_reached (); |