Ah reflect.StructOf! I totally missed that, that was the missing piece.
Thanks for the detailed response Ian, much appreciated.
Tibor
On Friday, August 18, 2023 at 11:06:27 PM UTC+2 Ian Lance Taylor wrote:
> On Fri, Aug 18, 2023 at 8:12 AM Tibor Halter wrote:
> >
> > Hi El
("v[%X]", *numVal.ptr)
}
}
var sink any
func escape(x any) {
sink = x
sink = nil
}
On Friday, August 18, 2023 at 5:12:18 PM UTC+2 Tibor Halter wrote:
> Hi Elias, thanks for chiming in!
>
> > The Go garbage collector is precise in that it only considers pointers
> whe
uct-like memory layout
dynamically, that contains a mix of pointer and non-pointer types, in a way
that is supported by the GC?
(This is what I'm trying to do.)
On Friday, August 18, 2023 at 3:49:03 PM UTC+2 ma...@eliasnaur.com wrote:
> On Friday, 18 August 2023 at 05:57:38 UTC-6 Tibor H
I am testing on Go 1.21.0, Linux, amd64
On Friday, August 18, 2023 at 1:57:38 PM UTC+2 Tibor Halter wrote:
> Thanks Ian!
>
> I have managed to strip it down to its essence, see code below.
>
> *Summary of what I'm doing*
> - reserve memory with make([]byte)
> - get p
mMemSize)
sliceDataPtr := unsafe.Pointer(unsafe.SliceData(b))
(*Num)(sliceDataPtr).numData = &n
runtime.GC()
act := (*Num)(sliceDataPtr).numData
if *act != 123456789 {
t.Fatalf("v[%X]", *act)
}
}
On Friday, August 18, 2023 at 2:59:46 AM UTC+2 Ian Lance Taylor wrote:
> On Thu, A
Hi!
I get this crash when using the GODEBUG option gccheckmark=1:
runtime: marking free object 0xc0016c5668 found at *(0xc0046ca8e0+0x8)
base=0xc0046ca8e0 s.base()=0xc0046ca000 s.limit=0xc0046cc000 s.spanclass=8
s.elemsize=32 s.state=mSpanInUse
*(base+0) = 0x15e11f0
*(base+8) = 0xc0016c5668 <=