(Actually, that address is an address on the stack, but that's only because
the backing store for emptySlice does not escape. It should also take ~no
space.)
On Wednesday, September 7, 2022 at 4:53:12 PM UTC-7 Keith Randall wrote:
> That address is not in the heap. It is the address of a specia
That address is not in the heap. It is the address of a special word in the
runtime, called runtime.zerobase, which is explicitly for this purpose. It
is a place to point things that need to be non-nil but have no size.
On Wednesday, September 7, 2022 at 12:01:28 PM UTC-7 me...@pobox.com wrote:
Running this:
emptyslice := []string{}
sh := (*reflect.SliceHeader)(unsafe.Pointer(&emptyslice))
fmt.Printf("empty slice cap = %d\n", sh.Cap)
fmt.Printf("empty slice len = %d\n", sh.Len)
fmt.Printf("empty slice uintptr = %v\n", sh.Data)
Output:
empty slice cap = 0
empty slice len = 0
emp
On Wed, Sep 7, 2022 at 12:28 PM Mustafa Durukan
wrote:
>
>
> *fakeObject := tt.Object.(TypeOfStruct)object := Object.(TypeOfStruct)*
If you can include the definitions of tt, explain what you want to do, and
what you mean by "didn't work", someone may be able to answer this
question. Without t
*fakeObject := tt.Object.(TypeOfStruct)object :=
Object.(TypeOfStruct)fakeObject.Field = object.FieldfakeObject.Field2 =
object.Field2*
I have case like that.
I want to assign sme object values to tt.Object but when i try to assign it
assings to fakeObject i mean copy of tt.Object so I cant