libc32.go 776 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2020 The Libc Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build 386 || arm
  5. // +build 386 arm
  6. package libc // import "modernc.org/libc"
  7. const (
  8. heapSize = 1 << 30 // Adjust for your debugging session requirements and system RAM size.
  9. )
  10. type (
  11. // RawMem represents the biggest byte array the runtime can handle
  12. RawMem [1<<31 - 1]byte
  13. // 32-5*4 = 12 bytes left to pad
  14. stackHeaderPadding struct {
  15. a uintptr
  16. b uintptr
  17. c uintptr
  18. }
  19. )
  20. type bits []int
  21. func newBits(n int) (r bits) { return make(bits, (n+31)>>5) }
  22. func (b bits) has(n int) bool { return b != nil && b[n>>5]&(1<<uint(n&31)) != 0 }
  23. func (b bits) set(n int) { b[n>>5] |= 1 << uint(n&31) }