简体   繁体   English

测量C代码中静态局部变量使用的内存

[英]measure memory used by static local variables in C code

Are there any static code metrics tools that measure total size of static local variables in c functions. 是否有任何静态代码度量工具来测量c函数中静态局部变量的总大小。 The tools that I explored report the stack size but not the size of the static local variables. 我探索的工具报告堆栈大小,但不报告静态局部变量的大小。 Is there another option apart from using linux objdump and parsing the output? 除了使用linux objdump和解析输出外,还有其他选择吗?

The POSIX size command can be used for this purpose. POSIX size命令可用于此目的。 The size of the data section is the size of all data in static storage (except data declared const on some targets). 数据节的大小是静态存储中所有数据的大小(某些目标上声明为const的数据除外)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM