Skip to content

Commit

Permalink
translate-all: Use g_try_malloc() for dynamic translator buffer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Gonglei <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
Markus Armbruster authored and Michael Tokarev committed Feb 10, 2015
1 parent 4b3be73 commit 8b98ade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion translate-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8b98ade

Please sign in to comment.