diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-04 11:26:07 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2015-02-10 09:27:21 +0300 |
commit | 8b98ade31ed7994d6bcbb0600ad0ea3f3d881088 (patch) | |
tree | 0e02e8211f240d1b9583b13c840b804e4c42f15d | |
parent | 4b3be73006d5d65d44bd482cc6e3cf2f4ab12c34 (diff) | |
download | qemu-8b98ade31ed7994d6bcbb0600ad0ea3f3d881088.zip qemu-8b98ade31ed7994d6bcbb0600ad0ea3f3d881088.tar.gz qemu-8b98ade31ed7994d6bcbb0600ad0ea3f3d881088.tar.bz2 |
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>
-rw-r--r-- | translate-all.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/translate-all.c b/translate-all.c index 4a1b64f..9f47ce7 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; |