diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-02-14 05:14:28 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-02-14 05:14:28 +0000 |
commit | d79fe0d64301cbe37e2ad0e25a051f8607f08807 (patch) | |
tree | 5cbd06fb7eeda4b6d395f2180572fbf2cdceeb68 /sim/mips | |
parent | 891e7fb179daec94b56e4a740f645e8685dee8e5 (diff) | |
download | gdb-d79fe0d64301cbe37e2ad0e25a051f8607f08807.zip gdb-d79fe0d64301cbe37e2ad0e25a051f8607f08807.tar.gz gdb-d79fe0d64301cbe37e2ad0e25a051f8607f08807.tar.bz2 |
sim: punt zfree()
The sim keeps track of which allocations are zero-ed internally (via
zalloc) and then calls a helper "zfree" function rather than "free".
But this "zfree" function simply calls "free" itself. Since I can
see no point in this and it is simply useless overhead, punt it.
The only real change is in hw-alloc.c where we remove the zalloc_p
tracking, and sim-utils.c where zfree is delete. The rest of the
changes are a simple `sed` from "zfree" to "free".
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/mips')
-rw-r--r-- | sim/mips/ChangeLog | 6 | ||||
-rw-r--r-- | sim/mips/dv-tx3904sio.c | 4 | ||||
-rw-r--r-- | sim/mips/interp.c | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 149bded..b19991f 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,9 @@ +2011-02-14 Mike Frysinger <vapier@gentoo.org> + + * dv-tx3904sio.c (tx3904sio_fifo_push): Change zfree to free. + (tx3904sio_fifo_reset): Likewise. + * interp.c (sim_monitor): Likewise. + 2010-04-14 Mike Frysinger <vapier@gentoo.org> * interp.c (sim_write): Add const to buffer arg. diff --git a/sim/mips/dv-tx3904sio.c b/sim/mips/dv-tx3904sio.c index 2156f58..24f0702 100644 --- a/sim/mips/dv-tx3904sio.c +++ b/sim/mips/dv-tx3904sio.c @@ -583,7 +583,7 @@ tx3904sio_fifo_push(struct hw* me, struct tx3904sio_fifo* fifo, char it) char* next_buf = zalloc(next_size); memcpy(next_buf, fifo->buffer, fifo->used); - if(fifo->buffer != NULL) zfree(fifo->buffer); + if(fifo->buffer != NULL) free(fifo->buffer); fifo->buffer = next_buf; fifo->size = next_size; } @@ -599,7 +599,7 @@ tx3904sio_fifo_reset(struct hw* me, struct tx3904sio_fifo* fifo) /* HW_TRACE ((me, "reset fifo")); */ fifo->used = 0; fifo->size = 0; - zfree(fifo->buffer); + free(fifo->buffer); fifo->buffer = 0; } diff --git a/sim/mips/interp.c b/sim/mips/interp.c index a276d06..492ae60 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -1285,7 +1285,7 @@ sim_monitor (SIM_DESC sd, { char *path = fetch_str (sd, A0); V0 = sim_io_open (sd, path, (int)A1); - zfree (path); + free (path); break; } @@ -1296,7 +1296,7 @@ sim_monitor (SIM_DESC sd, char *buf = zalloc (nr); V0 = sim_io_read (sd, fd, buf, nr); sim_write (sd, A1, buf, nr); - zfree (buf); + free (buf); } break; @@ -1311,7 +1311,7 @@ sim_monitor (SIM_DESC sd, sim_io_flush_stdout (sd); else if (fd == 2) sim_io_flush_stderr (sd); - zfree (buf); + free (buf); break; } |