aboutsummaryrefslogtreecommitdiff
path: root/sim/common/hw-alloc.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-02-14 05:14:28 +0000
committerMike Frysinger <vapier@gentoo.org>2011-02-14 05:14:28 +0000
commitd79fe0d64301cbe37e2ad0e25a051f8607f08807 (patch)
tree5cbd06fb7eeda4b6d395f2180572fbf2cdceeb68 /sim/common/hw-alloc.c
parent891e7fb179daec94b56e4a740f645e8685dee8e5 (diff)
downloadgdb-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/common/hw-alloc.c')
-rw-r--r--sim/common/hw-alloc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sim/common/hw-alloc.c b/sim/common/hw-alloc.c
index cb9a52f..7244baa 100644
--- a/sim/common/hw-alloc.c
+++ b/sim/common/hw-alloc.c
@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
struct hw_alloc_data {
void *alloc;
- int zalloc_p;
struct hw_alloc_data *next;
};
@@ -55,7 +54,6 @@ hw_zalloc (struct hw *me, unsigned long size)
{
struct hw_alloc_data *memory = ZALLOC (struct hw_alloc_data);
memory->alloc = zalloc (size);
- memory->zalloc_p = 1;
memory->next = me->alloc_of_hw;
me->alloc_of_hw = memory;
return memory->alloc;
@@ -66,7 +64,6 @@ hw_malloc (struct hw *me, unsigned long size)
{
struct hw_alloc_data *memory = ZALLOC (struct hw_alloc_data);
memory->alloc = zalloc (size);
- memory->zalloc_p = 0;
memory->next = me->alloc_of_hw;
me->alloc_of_hw = memory;
return memory->alloc;
@@ -85,11 +82,8 @@ hw_free (struct hw *me,
{
struct hw_alloc_data *die = (*memory);
(*memory) = die->next;
- if (die->zalloc_p)
- zfree (die->alloc);
- else
- free (die->alloc);
- zfree (die);
+ free (die->alloc);
+ free (die);
return;
}
}