[TD-13758]<fix>: add memory option.

This commit is contained in:
afwerar 2022-03-28 14:57:42 +08:00
parent 6baa845db3
commit 373865a3b0
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,7 @@ typedef struct TdMemoryInfo
#else #else
#include<execinfo.h> #include<execinfo.h>
#define STACKCALL __attribute__((regparm(1), noinline)) #define STACKCALL __attribute__((regparm(1), noinline))
void **STACKCALL taosGetEbp(void) { void **STACKCALL taosGetEbp(void) {
void **ebp = NULL; void **ebp = NULL;
@ -42,6 +43,7 @@ void **STACKCALL taosGetEbp(void) {
: "memory"); /* not affect register */ : "memory"); /* not affect register */
return (void **)(*ebp); return (void **)(*ebp);
} }
int32_t taosBackTrace(void **buffer, int32_t size) { int32_t taosBackTrace(void **buffer, int32_t size) {
int32_t frame = 0; int32_t frame = 0;
void **ebp; void **ebp;
@ -60,6 +62,7 @@ int32_t taosBackTrace(void **buffer, int32_t size) {
} }
return frame; return frame;
} }
#endif #endif
// char **taosBackTraceSymbols(int32_t *size) { // char **taosBackTraceSymbols(int32_t *size) {