aboutsummaryrefslogtreecommitdiff
path: root/translate-all.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-04 11:26:07 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2015-02-10 09:27:21 +0300
commit8b98ade31ed7994d6bcbb0600ad0ea3f3d881088 (patch)
tree0e02e8211f240d1b9583b13c840b804e4c42f15d /translate-all.c
parent4b3be73006d5d65d44bd482cc6e3cf2f4ab12c34 (diff)
translate-all: Use g_try_malloc() for dynamic translator buffer
The USE_MMAP code can fail, and the caller handles the failure already. Let the !USE_MMAP code fail as well, for consistency. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'translate-all.c')
-rw-r--r--translate-all.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/translate-all.c b/translate-all.c
index 4a1b64fd83..9f47ce7f71 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -631,7 +631,7 @@ static inline void *alloc_code_gen_buffer(void)
#else
static inline void *alloc_code_gen_buffer(void)
{
- void *buf = g_malloc(tcg_ctx.code_gen_buffer_size);
+ void *buf = g_try_malloc(tcg_ctx.code_gen_buffer_size);
if (buf == NULL) {
return NULL;