mirror of
https://github.com/Tencent/libco.git
synced 2025-05-09 12:11:10 +08:00
Make stack sp aligned
This commit is contained in:
parent
c79e3e8869
commit
58651e99e8
@ -108,8 +108,8 @@ int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) {
|
|||||||
}
|
}
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) {
|
int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) {
|
||||||
char* sp = ctx->ss_sp + ctx->ss_size;
|
char* sp = ctx->ss_sp + ctx->ss_size - sizeof(void*);
|
||||||
sp = (char*)((unsigned long)sp & -16LL) - sizeof(void*);
|
sp = (char*)((unsigned long)sp & -16LL);
|
||||||
|
|
||||||
memset(ctx->regs, 0, sizeof(ctx->regs));
|
memset(ctx->regs, 0, sizeof(ctx->regs));
|
||||||
void** ret_addr = (void**)(sp);
|
void** ret_addr = (void**)(sp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user