asm_amd64.s 
<https://github.com/golang/go/blob/master/src/runtime/asm_amd64.s>

Please explain why 104 should be subtracted from g0 stack?
```go

TEXT runtime·rt0_go(SB),NOSPLIT|TOPFRAME,$0

   // copy arguments forward on an even stack

   MOVQ    DI, AX        // argc

   MOVQ    SI, BX        // argv

   SUBQ    $(5*8), SP        // 3args 2auto

   ANDQ    $~15, SP

   MOVQ    AX, 24(SP)

   MOVQ    BX, 32(SP)



   // create istack out of the given (operating system) stack.

   // _cgo_init may update stackguard.

   MOVQ    $runtime·g0(SB), DI

   LEAQ    (-64*1024+104)(SP), BX

   MOVQ    BX, g_stackguard0(DI)

   MOVQ    BX, g_stackguard1(DI)

   MOVQ    BX, (g_stack+stack_lo)(DI)

   MOVQ    SP, (g_stack+stack_hi)(DI)
```

but asm_arm64.s is 64kb:
asm_arm64.s 
<https://github.com/golang/go/blob/master/src/runtime/asm_arm64.s>

```go

   // create istack out of the given (operating system) stack.

   // _cgo_init may update stackguard.

   MOVD    $runtime·g0(SB), g

   MOVD    RSP, R7

   MOVD    $(-64*1024)(R7), R0

   MOVD    R0, g_stackguard0(g)

   MOVD    R0, g_stackguard1(g)

   MOVD    R0, (g_stack+stack_lo)(g)

   MOVD    R7, (g_stack+stack_hi)(g)
```

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6be1ed1e-d6f5-4942-9d4a-746ea27687a1n%40googlegroups.com.

Reply via email to