diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 22:09:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 23:01:08 -0500 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /readline.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (diff) |
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'readline.c')
-rw-r--r-- | readline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/readline.c b/readline.c index 92f9cd1569..6a3160aba5 100644 --- a/readline.c +++ b/readline.c @@ -264,7 +264,7 @@ static void readline_hist_add(ReadLineState *rs, const char *cmdline) void readline_add_completion(ReadLineState *rs, const char *str) { if (rs->nb_completions < READLINE_MAX_COMPLETIONS) { - rs->completions[rs->nb_completions++] = qemu_strdup(str); + rs->completions[rs->nb_completions++] = g_strdup(str); } } @@ -281,11 +281,11 @@ static void readline_completion(ReadLineState *rs) rs->nb_completions = 0; - cmdline = qemu_malloc(rs->cmd_buf_index + 1); + cmdline = g_malloc(rs->cmd_buf_index + 1); memcpy(cmdline, rs->cmd_buf, rs->cmd_buf_index); cmdline[rs->cmd_buf_index] = '\0'; rs->completion_finder(cmdline); - qemu_free(cmdline); + g_free(cmdline); /* no completion found */ if (rs->nb_completions <= 0) @@ -466,7 +466,7 @@ const char *readline_get_history(ReadLineState *rs, unsigned int index) ReadLineState *readline_init(Monitor *mon, ReadLineCompletionFunc *completion_finder) { - ReadLineState *rs = qemu_mallocz(sizeof(*rs)); + ReadLineState *rs = g_malloc0(sizeof(*rs)); rs->hist_entry = -1; rs->mon = mon; |