summaryrefslogtreecommitdiff
path: root/src/target/armv4_5.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-19 13:23:49 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-19 13:23:49 -0800
commit8f446fcf676e9cd13cf53d9946f0cae5d29a10ec (patch)
tree840321d1f6f90fc4b20b94a275a1c94307e18f82 /src/target/armv4_5.c
parentcbc13187c315227c0cf8d85fb0b92d0ba4a10dab (diff)
downloadopenocd+libswd-8f446fcf676e9cd13cf53d9946f0cae5d29a10ec.tar.gz
openocd+libswd-8f446fcf676e9cd13cf53d9946f0cae5d29a10ec.tar.bz2
openocd+libswd-8f446fcf676e9cd13cf53d9946f0cae5d29a10ec.tar.xz
openocd+libswd-8f446fcf676e9cd13cf53d9946f0cae5d29a10ec.zip
ARM: remove per-register malloc
Just pre-allocate memory for the cached register value. Shrinks heap overhead; increases locality-of-reference. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/armv4_5.c')
-rw-r--r--src/target/armv4_5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index b6061af3..44e5b0ac 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -489,7 +489,7 @@ struct reg_cache* armv4_5_build_reg_cache(struct target *target, struct arm *arm
reg_list[i].name = (char *) arm_core_regs[i].name;
reg_list[i].size = 32;
- reg_list[i].value = calloc(1, 4);
+ reg_list[i].value = &arch_info[i].value;
reg_list[i].type = &arm_reg_type;
reg_list[i].arch_info = &arch_info[i];