[英]Useless allocated Stackspace?
在調用gets()之前,為什么這個函數會分配比它需要的更多的堆棧空間?
gets()
echo: pushl %ebp movl %esp, %ebp pushl %ebx leal -8(%ebp), %ebx subl $20, %esp <-- Why so much space? movl %ebx, (%esp) call gets ...
相應的C代碼:
void echo() { char buf[4]; gets(buf); puts(buf); }
為什么在緩沖區和gets的參數之間還有三個單詞的額外空間?
計算機系統一書中有兩句話。 “gcc遵循x86編程指南,該函數使用的總堆棧空間應為16字節的倍數。” 和“包括保存的%ebp的4個字節和返回地址的4個字節”,
[英]“useless type qualifier” error
[英]Bison nonterminal useless in grammar, rule useless in parser
[英]Are argc & argv useless in Windows?
[英]Contiguously allocated vs sequentially allocated
[英]GCC generating useless code in ISR
[英]Variable modification within a useless condition
[英]The function only works with a useless printf
[英]Dynamically allocated array of dynamically allocated strings
[英]stack allocated memory versus dynamically allocated memory
[英]Statically allocated array of pointers to statically allocated structures
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.