diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-06 08:37:17 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-06 08:37:17 +0000 |
commit | 2137b4cca9af2ca22b527ef9f3835c532511453d (patch) | |
tree | b758c587161d84c6c2b535f2fdedc48039282170 /hw | |
parent | bf6bca527c11dff117990acdeb8cb425e985788a (diff) |
Add qemu_realloc(), by Gerd Hoffmann.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4986 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/blizzard.c | 2 | ||||
-rw-r--r-- | hw/lsi53c895a.c | 2 | ||||
-rw-r--r-- | hw/rtl8139.c | 2 | ||||
-rw-r--r-- | hw/soc_dma.c | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/hw/blizzard.c b/hw/blizzard.c index 37330e7f2e..4fb005e363 100644 --- a/hw/blizzard.c +++ b/hw/blizzard.c @@ -192,7 +192,7 @@ static int blizzard_transfer_setup(struct blizzard_s *s) s->data.len = s->bpp * s->data.dx * s->data.dy; s->data.pitch = s->data.dx; if (s->data.len > s->data.buflen) { - s->data.buf = realloc(s->data.buf, s->data.len); + s->data.buf = qemu_realloc(s->data.buf, s->data.len); s->data.buflen = s->data.len; } s->data.ptr = s->data.buf; diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index a08cfd9e3e..9a212e25f0 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -501,7 +501,7 @@ static void lsi_queue_command(LSIState *s) DPRINTF("Queueing tag=0x%x\n", s->current_tag); if (s->queue_len == s->active_commands) { s->queue_len++; - s->queue = realloc(s->queue, s->queue_len * sizeof(lsi_queue)); + s->queue = qemu_realloc(s->queue, s->queue_len * sizeof(lsi_queue)); } p = &s->queue[s->active_commands++]; p->tag = s->current_tag; diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 0222d421ea..6aec2fffc6 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -2001,7 +2001,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s) while (s->cplus_txbuffer && s->cplus_txbuffer_offset + txsize >= s->cplus_txbuffer_len) { s->cplus_txbuffer_len += CP_TX_BUFFER_SIZE; - s->cplus_txbuffer = realloc(s->cplus_txbuffer, s->cplus_txbuffer_len); + s->cplus_txbuffer = qemu_realloc(s->cplus_txbuffer, s->cplus_txbuffer_len); DEBUG_PRINT(("RTL8139: +++ C+ mode transmission buffer space changed to %d\n", s->cplus_txbuffer_len)); } diff --git a/hw/soc_dma.c b/hw/soc_dma.c index 4ff8cae7c2..4c87c8b9bd 100644 --- a/hw/soc_dma.c +++ b/hw/soc_dma.c @@ -50,7 +50,7 @@ static int fifo_size; void transfer_fifo2fifo(struct soc_dma_ch_s *ch) { if (ch->bytes > fifo_size) - fifo_buf = realloc(fifo_buf, fifo_size = ch->bytes); + fifo_buf = qemu_realloc(fifo_buf, fifo_size = ch->bytes); /* Implement as transfer_fifo2linear + transfer_linear2fifo. */ ch->io_fn[0](ch->io_opaque[0], fifo_buf, ch->bytes); @@ -262,7 +262,7 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, target_phys_addr_t virt_base, struct memmap_entry_s *entry; struct dma_s *dma = (struct dma_s *) soc; - dma->memmap = realloc(dma->memmap, sizeof(*entry) * + dma->memmap = qemu_realloc(dma->memmap, sizeof(*entry) * (dma->memmap_size + 1)); entry = soc_dma_lookup(dma, virt_base); @@ -314,7 +314,7 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, struct memmap_entry_s *entry; struct dma_s *dma = (struct dma_s *) soc; - dma->memmap = realloc(dma->memmap, sizeof(*entry) * + dma->memmap = qemu_realloc(dma->memmap, sizeof(*entry) * (dma->memmap_size + 1)); entry = soc_dma_lookup(dma, virt_base); |