<FromGitter>
<Dan-Do> In crystal wrapper I have `key = Lib::IwkvVal.new(data: Slice(UInt64).new(1).to_unsafe, size: sizeof(UInt64), compound: 0_u64)`
<FromGitter>
<Dan-Do> Do I need to call `Lib.iwkv_val_dispose(pointerof(key))` manually?
<FromGitter>
<straight-shoota> You're not allocating any heap memory. The value is just put on the stack which vanishes as soon as the program leaves the scope.
<FromGitter>
<straight-shoota> Whether you need to inform the library about disposing a value is a question for the library, not Crystal.
<FromGitter>
<Dan-Do> Uhm, but I see the memory takes to 2GB when using `top` command to monitor my process
<FromGitter>
<straight-shoota> Dunno where that's coming from. Certainly not from that initializer. That should put roughly 12 bytes on the stack (and allocate 4 on the heap for the slice, but that's managed by the GC)
<FromGitter>
<Dan-Do> Is there any method to tell me about where does 2GB come from?
<FromGitter>
<straight-shoota> `GC.stats` could help
<FromGitter>
<Dan-Do> Thank you, I will try
<FromGitter>
<Dan-Do> There are errors when doing dispose/free the memory manually. ⏎ `munmap_chunk(): invalid pointer` ⏎ `free(): invalid pointer`
<straight-shoota>
You can't free a stack pointer
<FromGitter>
<Dan-Do> Yes, I can only free a pointer which is allocated in C lib `out var`
avane_ has quit [Quit: o/]
avane has joined #crystal-lang
yxhuvud has quit [Remote host closed the connection]