#Allocation does not match resize (gpa)

1 messages ยท Page 1 of 1 (latest)

stuck steeple
#

what's the type of partial.plaintext? did you set the alignment explicitly?

stuck steeple
#

the only way i could recreate this was by setting the capacity of the list explicitly list.capacity = 1; which you shouldnt do

primal idol
#

pretty sure I dont do that

stuck steeple
#

could you maybe send your code?

primal idol
#

Of course

#

In case you don't have enough time to debug this, could you point me to any resources when it comes to Zig debugging?

stuck steeple
#

i commented out a lot of stuff so it would work on windows and i didnt seem to get that bug

#

(didnt comment out the actual buggy part, just the linux specific parts)

#

valgrind might help? i couldnt tell you though, im sorry ๐Ÿ˜…

primal idol
#

I have to type 12

#

Thanks for trying, though ๐Ÿ™‚

stuck steeple
#

oh i got it too, ill look into it more then

#

ah youre only appending numbers, i should have noticed that ๐Ÿ˜…

primal idol
#

It's hard to see stuff like that immediately haha

stuck steeple
#

oh it might be 385:
config.code = syntax.create(partial.plaintext.items, null, null);
youre passing only part of an owned slice, items isnt the entire allocated slice, its just the part thats populated. changing it to:
config.code = syntax.create(partial.plaintext.toOwnedSlice() catch unreachable, null, null);
fixes it for me

primal idol
#

Why is it a problem that I'm passing only a part of an owned slice?

stuck steeple
#

well like fromOwnedSlice says youre saying "take ownership of this slice" but youre leaving behind the rest of the slice

#

since the actual "owned" part of it is potentially bigger than the part you passed

primal idol
#

Okay, I clearly don't understand ownership

#

I'll read up on that

#

Thanks for your help!