[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 36/46] translate-all: Use g_try_malloc() for dynamic

From: Michael Tokarev
Subject: [Qemu-devel] [PULL 36/46] translate-all: Use g_try_malloc() for dynamic translator buffer
Date: Tue, 10 Feb 2015 09:34:25 +0300

From: Markus Armbruster <address@hidden>

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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
 translate-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
 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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]