[go-nuts] Re: programmatic way to find if application go binary is built with -cover flag ?

2024-05-14 Thread Akash Kumar
I unable to find a flag from corresponds to -cover in the result returned from debug.buildInfo On Monday, May 13, 2024 at 10:51:33 PM UTC+5:30 Tamás Gulácsi wrote: > runtime/debug.ReadBuildInfo is a good source of truth: > $ strings bin/godeb|grep '^build\s' > > build -buildmode=exe > build

Re: [go-nuts] Bitmask is slower than modulo calculation

2024-05-14 Thread 'Keith Randall' via golang-nuts
Your test is benchmarking int->any conversions more than it is testing the underlying modulo/mask difference. When you pass an integer to Enqueue, it is converted to any, which (usually) involves an allocation. That will swamp the cost of any single arithmetic operation. There are a few ways to

Re: [go-nuts] Re: raw bit types without arithmetic

2024-05-14 Thread jimmy frasche
Arrays are arrays regardless of what they're arrays of. So it would be strange for arrays of certain things to have properties that other arrays don't have and bitwise ops don't make sense for arrays of, say, strings. Also some processors support these sizes natively but wouldn't support a [4096]b

[go-nuts] using runtime cgo.Handle passing struct types

2024-05-14 Thread Pavan
Hi, I need to pass value of struct type, which has C strings and functions to C function as void* argument. C layer would provide this struct type data back to go function. Below is the sample program. It panics if the handle used is returned from getH function. It works fine if the handle is