Hi, I was wondering why is `var f [d * 4]byte` allocated with
`runtime.newobject`, as we can see the size is already known at compile
time because `d` is a constant value, by doing some propagation we can
end up having `[16]byte`.
TIA
42 . . }
43 . . }
44 . .
45 . . type ffx struct{}
46 . .
47 2MB 2MB func (ffx) PrecompF(a cipher.Block, h int, g string, e int) (res [16]byte) {
48 . . const d = 4
49 1MB 1MB var f [d * 4]byte
. . 5aa4e0: LEAQ 0x1ec59(IP), AX ffx.go:49
1MB 1MB 5aa4e7: CALL
runtime.newobject(SB) ffx.go:49
. . 5aa4ec: MOVQ AX, 0x60(SP)
ffx.go:49
50 . . fv := (*[d]uint32)(unsafe.Pointer(&f[0]))
51 . . c := len(g)
52 . . b := 10
53 . .
54 . . fv[0] |= 0x01_02_01_00
55 . . fv[0] |= uint32((e >> 16) & 255)
56 . .
57 . . fv[1] |= uint32((e >> 8) & 255 << 24)
58 . . fv[1] |= uint32((e & 255) << 16)
59 . . fv[1] |= uint32(b << 8)
60 . . fv[1] |= uint32((h / 2) & 255)
61 . .
62 . . fv[2] = uint32(h)
63 . . fv[3] = uint32(c)
64 . .
65 . . endianSwaps(fv)
66 . . a.Encrypt(res[:], f[:])
67 . . return
68 . . }
69 . .
70 . . func (ffx) Precompb(c int, g int) int {
71 . . var e int64 = int64(g) / 2
72 . . var a int = 0
--
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/49779ba7-7ee8-4c2a-ab51-88101c6daaaa%40gmail.com.