Cygwin: move __caller_return_address to mm/malloc_wrapper.cc

It's used in this file only anyway, so make it static inline.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-08-10 17:07:52 +02:00
parent 5851a633bd
commit afa7117999
3 changed files with 17 additions and 17 deletions

View File

@ -77,10 +77,6 @@ public:
extern "C" void yield ();
#define caller_return_address() \
__caller_return_address (__builtin_return_address (0))
void * __caller_return_address (void *);
void backslashify (const char *, char *, bool);
void slashify (const char *, char *, bool);
#define isslash(c) ((c) == '/')

View File

@ -315,19 +315,6 @@ NT_readline::gets ()
}
}
/* Helper function to generate the correct caller address. For external
calls, the return address on the stack is _sigbe. In that case the
actual caller return address is on the cygtls stack. Use this function
via the macro caller_return_address. */
extern "C" void _sigbe ();
void *
__caller_return_address (void *builtin_ret_addr)
{
return builtin_ret_addr == &_sigbe
? (void *) _my_tls.retaddr () : builtin_ret_addr;
}
/* CygwinCreateThread.
Replacement function for CreateThread. What we do here is to remove

View File

@ -27,6 +27,23 @@ extern "C" struct mallinfo dlmallinfo ();
static bool use_internal = true;
static bool internal_malloc_determined;
/* Helper function to generate the correct caller address. For external
calls, the return address on the stack is _sigbe. In that case the
actual caller return address is on the cygtls stack. Use this function
via the macro caller_return_address. */
extern "C" void _sigbe ();
static inline void *
__caller_return_address (void *builtin_ret_addr)
{
return builtin_ret_addr == &_sigbe
? (void *) _my_tls.retaddr () : builtin_ret_addr;
}
#define caller_return_address() \
__caller_return_address (__builtin_return_address (0))
void * __caller_return_address (void *);
/* Return an address from the import jmp table of main program. */
static inline void *
import_address (void *imp)