#Allocation function's ret_addr usage

1 messages · Page 1 of 1 (latest)

odd prism
#

Hello, I'm looking at the allocation function signature and there is a ret_addr parameter. What is this used for? isnt the return address accesible to the function implicitly using the ABI? why pass it as a parameter aswell?

#

Allocation function's ret_addr usage

topaz flicker
#

It's used so allocators can attach backtraces to allocations (eg. GPA does this for leak checking)

#

The advantage over @returnAddress() directly is that the wrapper functions can pass their return addresses, so you skip a few irrelevant stack frames