diff options
author | Larry Ewing <lewing@microsoft.com> | 2020-03-09 18:58:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 18:58:11 +0300 |
commit | 66545a2abd8686d386865323b958b57ed07fee35 (patch) | |
tree | c4d8828e71d8aa93efb8631e46d699ac78f5d240 /sdks | |
parent | a25fe91245866638c53157db3eb431afdb3141fd (diff) |
[wasm] remove m_strdup (#19158)
Diffstat (limited to 'sdks')
-rw-r--r-- | sdks/wasm/src/driver.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sdks/wasm/src/driver.c b/sdks/wasm/src/driver.c index 25a131d5630..69c65eefac5 100644 --- a/sdks/wasm/src/driver.c +++ b/sdks/wasm/src/driver.c @@ -68,16 +68,6 @@ void mono_trace_init (void); #define g_new(type, size) ((type *) malloc (sizeof (type) * (size))) #define g_new0(type, size) ((type *) calloc (sizeof (type), (size))) -static char* -m_strdup (const char *str) -{ - if (!str) - return NULL; - - const size_t len = strlen (str) + 1; - return memcpy (g_new (char, len), str, len); -} - static MonoDomain *root_domain; static MonoString* @@ -154,14 +144,14 @@ mono_wasm_add_assembly (const char *name, const unsigned char *data, unsigned in { int len = strlen (name); if (!strcasecmp (".pdb", &name [len - 4])) { - char *new_name = m_strdup (name); + char *new_name = strdup (name); //FIXME handle debugging assemblies with .exe extension strcpy (&new_name [len - 3], "dll"); mono_register_symfile_for_assembly (new_name, data, size); return; } WasmAssembly *entry = g_new0 (WasmAssembly, 1); - entry->assembly.name = m_strdup (name); + entry->assembly.name = strdup (name); entry->assembly.data = data; entry->assembly.size = size; entry->next = assemblies; |