[go-nuts] Re: zero in the new unique package

2024-12-04 Thread Cuong Manh Le
Hello, > My understanding is the `zero` variable just provides a unique memory location, and any type, e.g. byte, would have worked just as well. Is this right? Yes. > Was uintptr choosen for performance reasons? Or to guarantee alignment? None of the above. `uintptr` was chosen for being

[go-nuts] Re: //go:norace doesn't effect ABI0 wrapper

2022-11-30 Thread Cuong Manh Le
See my suggestion here: https://github.com/ebitengine/purego/issues/71#issuecomment-1332545306 For //go:norace and ABI wrapper functions, there's no instrument emitted. Your problem is that the compiler know there's a native ABI0 implementation for x_cgo_init, so calling it from assembly is f

[go-nuts] Re: Question on 'src/internal/singleflight': The return result of the ForgetUnshared method seems to be inaccurate

2022-09-22 Thread Cuong Manh Le
I sent https://go-review.googlesource.com/c/go/+/433315 for fixing the issue. On Friday, September 23, 2022 at 10:59:03 AM UTC+7 atomic wrote: > No wonder I didn't find related questions, the method names in the two > packages are different: > One is Forget and the other is ForgetUnshared > > 在

[go-nuts] Re: Question on 'src/internal/singleflight': The return result of the ForgetUnshared method seems to be inaccurate

2022-09-22 Thread Cuong Manh Le
Seems to me this commit is not port to the internal singleflight: https://github.com/golang/sync/commit/56d357773e8497dfd526f0727e187720d1093757 On Friday, September 23, 2022 at 9:23:29 AM UTC+7 atomic wrote: > Thank you so much, so happy, you are amazing. > You answered a question that has bee

[go-nuts] Re: Question on 'src/internal/singleflight': The return result of the ForgetUnshared method seems to be inaccurate

2022-09-21 Thread Cuong Manh Le
Hello, You use time.Sleep in your program, so the behavior is not predictable. In fact, I get it success or panic randomly. You can see https://go-review.googlesource.com/c/sync/+/424114 to see a predictable test of ForgetUnshared . On Wednesday, September 21, 2022 at 1:45:24 PM UTC+7 atomic w

Re: [go-nuts] Re: go1.17rc2 fails to compile slice-to-array-pointer conversions if go.mod doesn't specify go directive

2021-08-11 Thread Cuong Manh Le
RwadYSTC65zcr7pK/iarBRwadYSTC65zcr7pK -dwarf=false -D _/Users/cuonglm/t -importcfg $WORK/b001/importcfg -pack ./main.go $WORK/b001/_gomod_.go ``` Notice "-lang" is passed two times, and the later "-lang=go1.16" wins. Cuong Manh Le https://cuonglm.xyz On Thu, Aug 12, 202

Re: [go-nuts] On tip, arguments of panic escape to heap

2021-05-23 Thread Cuong Manh Le
Hi, It's normal, go1.16 and before is just incorrect for not reporting that escaping. See: https://go-review.googlesource.com/c/go/+/284412 Cheers, Cuong On Sun, May 23, 2021 at 2:43 PM tapi...@gmail.com wrote: > Go 1.16 doesn't make this. > Is it nornal? > > package main > > func main(){ >

Re: [go-nuts] Is unsafe.Pointer(reflect.Value.UnsafeAddr()) safe?

2021-04-18 Thread Cuong Manh Le
What's your platform? On M1, checkptr reports an error for me. The code: ptr := unsafe.Pointer(rf.UnsafeAddr()) is safe, but: x := rf.UnsafeAddr() ptr = unsafe.Pointer(x) is not. Cuong Manh Le https://cuonglm.xyz On Sun, Apr 18, 2021 at 6:46 AM Name No