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:
parent
5851a633bd
commit
afa7117999
|
@ -77,10 +77,6 @@ public:
|
||||||
|
|
||||||
extern "C" void yield ();
|
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 backslashify (const char *, char *, bool);
|
||||||
void slashify (const char *, char *, bool);
|
void slashify (const char *, char *, bool);
|
||||||
#define isslash(c) ((c) == '/')
|
#define isslash(c) ((c) == '/')
|
||||||
|
|
|
@ -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.
|
/* CygwinCreateThread.
|
||||||
|
|
||||||
Replacement function for CreateThread. What we do here is to remove
|
Replacement function for CreateThread. What we do here is to remove
|
||||||
|
|
|
@ -27,6 +27,23 @@ extern "C" struct mallinfo dlmallinfo ();
|
||||||
static bool use_internal = true;
|
static bool use_internal = true;
|
||||||
static bool internal_malloc_determined;
|
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. */
|
/* Return an address from the import jmp table of main program. */
|
||||||
static inline void *
|
static inline void *
|
||||||
import_address (void *imp)
|
import_address (void *imp)
|
||||||
|
|
Loading…
Reference in New Issue