mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
14015304b6
commit
7267c0947d
357 changed files with 1672 additions and 1674 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint)
|
||||
{
|
||||
qsg->sg = qemu_malloc(alloc_hint * sizeof(ScatterGatherEntry));
|
||||
qsg->sg = g_malloc(alloc_hint * sizeof(ScatterGatherEntry));
|
||||
qsg->nsg = 0;
|
||||
qsg->nalloc = alloc_hint;
|
||||
qsg->size = 0;
|
||||
|
@ -23,7 +23,7 @@ void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
|
|||
{
|
||||
if (qsg->nsg == qsg->nalloc) {
|
||||
qsg->nalloc = 2 * qsg->nalloc + 1;
|
||||
qsg->sg = qemu_realloc(qsg->sg, qsg->nalloc * sizeof(ScatterGatherEntry));
|
||||
qsg->sg = g_realloc(qsg->sg, qsg->nalloc * sizeof(ScatterGatherEntry));
|
||||
}
|
||||
qsg->sg[qsg->nsg].base = base;
|
||||
qsg->sg[qsg->nsg].len = len;
|
||||
|
@ -33,7 +33,7 @@ void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
|
|||
|
||||
void qemu_sglist_destroy(QEMUSGList *qsg)
|
||||
{
|
||||
qemu_free(qsg->sg);
|
||||
g_free(qsg->sg);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue