Re: [go-nuts] Is this a typo/bug in runtime.heapBitsSetType?

67 views
Skip to first unread message

Axel Wagner

unread,
Jun 10, 2021, 2:25:31 AM6/10/21
to steve wang, golang-nuts
The comment says "Advance two words", so I assume no?

On Thu, Jun 10, 2021 at 6:14 AM steve wang <steve....@gmail.com> wrote:
go 1.16.5
runtime/mbitmap.go:946
  1. switch h.shift {
  2. case 0:
  3. *h.bitp &^= mask3 << 0
  4. *h.bitp |= hb << 0
  5. case 1:
  6. *h.bitp &^= mask3 << 1
  7. *h.bitp |= hb << 1
  8. case 2:
  9. *h.bitp &^= mask2 << 2
  10. *h.bitp |= (hb & mask2) << 2
  11. // Two words written to the first byte.
  12. // Advance two words to get to the next byte.
  13. h = h.next().next() // line:946 <=== shouldn't it be "h=h.next()"???
  14. *h.bitp &^= mask1
  15. *h.bitp |= (hb >> 2) & mask1
  16. case 3:
  17. *h.bitp &^= mask1 << 3
  18. *h.bitp |= (hb & mask1) << 3
  19. // One word written to the first byte.
  20. // Advance one word to get to the next byte.
  21. h = h.next()
  22. *h.bitp &^= mask2
  23. *h.bitp |= (hb >> 1) & mask2
  24. }

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/98d3b51f-87c7-4abc-b41b-be2c84981b2bn%40googlegroups.com.

steve wang

unread,
Jun 10, 2021, 2:37:59 AM6/10/21
to golang-nuts
Thanks for your anwer.
It's my misreading.
Reply all
Reply to author
Forward
0 new messages