allocStack allocates and maps a stack in to any available part of the address space.
(ctx context.Context, m *mm.MemoryManager, a *arch.Context64)
| 156 | |
| 157 | // allocStack allocates and maps a stack in to any available part of the address space. |
| 158 | func allocStack(ctx context.Context, m *mm.MemoryManager, a *arch.Context64) (*arch.Stack, error) { |
| 159 | ar, err := m.MapStack(ctx) |
| 160 | if err != nil { |
| 161 | return nil, err |
| 162 | } |
| 163 | return &arch.Stack{Arch: a, IO: m, Bottom: ar.End}, nil |
| 164 | } |
| 165 | |
| 166 | const ( |
| 167 | // maxLoaderAttempts is the maximum number of attempts to try to load |