summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-11-22 18:50:57 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-11-22 18:50:57 +0100
commit7daec5a0ce109c04b117d42374a99b849fd8a89a (patch)
tree2c8e5e200796516ce9b9d158acc3e9b0103d90b5
parent5c4a73d0d89989b7fbe260ed4fa00a8259e01b03 (diff)
downloadopenocd_libswd-7daec5a0ce109c04b117d42374a99b849fd8a89a.tar.gz
openocd_libswd-7daec5a0ce109c04b117d42374a99b849fd8a89a.tar.bz2
openocd_libswd-7daec5a0ce109c04b117d42374a99b849fd8a89a.tar.xz
openocd_libswd-7daec5a0ce109c04b117d42374a99b849fd8a89a.zip
todo: add tip on how to identify excessive stack usage
Use dynamic allocations for working memory rather than stack. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--TODO16
1 files changed, 16 insertions, 0 deletions
diff --git a/TODO b/TODO
index 8713e818..2b7fad9b 100644
--- a/TODO
+++ b/TODO
@@ -306,6 +306,22 @@ These ideas were first introduced here: @par
The following architectural tasks need to be accomplished and should be
fairly easy to complete:
+
+- use dynamic allocations for working memory. Scan & fix code
+for excessive stack allocations. take linux/scripts/checkpatch.pl and
+see what the worst offenders are. Example, on amd64:
+
+ $ objdump -d | checkpatch.pl | head -10
+ 0x004311e3 image_open [openocd]: 13464
+ 0x00431301 image_open [openocd]: 13464
+ 0x004237a4 target_array2mem [openocd]: 4376
+ 0x0042382b target_array2mem [openocd]: 4376
+ 0x00423e74 target_mem2array [openocd]: 4360
+ 0x00423ef9 target_mem2array [openocd]: 4360
+ 0x00404aed handle_svf_command [openocd]: 2248
+ 0x00404b7e handle_svf_command [openocd]: 2248
+ 0x00413581 handle_flash_fill_command [openocd]: 2200
+ 0x004135fa handle_flash_fill_command [openocd]: 2200
- clean-up code to match style guides
- factor code to eliminate duplicated functionality
- rewrite code that uses casts to access 16-bit and larger types