Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Technically one does not need the second stack to implement this. One can use the main stack to place all dynamically sized things. The trick is then on the return copy the dynamically sized thing to insert it before the caller return address stored on the stack. The caller will see it then as if the new thing was allocated on its stack after the call.

But using the second stack is just simpler, avoids the extra copies and more compatible with the mainstream ABI.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: