ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
hightower2 has joined #crystal-lang
HumanG33k has joined #crystal-lang
avane_ has joined #crystal-lang
avane has quit [Ping timeout: 268 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
Munto has quit [Ping timeout: 250 seconds]
Munto has joined #crystal-lang
sagax has joined #crystal-lang
dmgk has quit [*.net *.split]
dmgk has joined #crystal-lang
ur5us has joined #crystal-lang
adam12 has quit [*.net *.split]
Vexatos_ has quit [*.net *.split]
brw has quit [*.net *.split]
hexology has quit [*.net *.split]
lanodan has quit [*.net *.split]
jrayhawk has quit [*.net *.split]
void09_ has quit [*.net *.split]
void09 has joined #crystal-lang
lanodan has joined #crystal-lang
adam12 has joined #crystal-lang
lanodan is now known as Guest6499
hexology has joined #crystal-lang
Vexatos has joined #crystal-lang
jrayhawk has joined #crystal-lang
brw has joined #crystal-lang
Chillfox has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 264 seconds]
Liothen has quit [Ping timeout: 260 seconds]
r0bby has quit [Ping timeout: 260 seconds]
kiwiroy has quit [Ping timeout: 268 seconds]
kevinsjoberg has quit [Ping timeout: 265 seconds]
pusewic|away_ has quit [Ping timeout: 264 seconds]
kevinsjoberg has joined #crystal-lang
pusewic|away_ has joined #crystal-lang
Liothen has joined #crystal-lang
r0bby has joined #crystal-lang
kiwiroy has joined #crystal-lang
sagax has quit [Excess Flood]
hightower2 has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
sagax has joined #crystal-lang
Guest6499 has quit [Quit: WeeChat 3.3]
lanodan has joined #crystal-lang
greenbigfrog has quit [Ping timeout: 246 seconds]
greenbigfrog has joined #crystal-lang
<FromGitter> <Dan-Do> In lib C binding, do I need to dispose/free the memory which is initialized in crystal?
<FromGitter> <Dan-Do> for example, C lib has a struct like this ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ And a func like this `fun iwkv_val_dispose(kval : IwkvVal*)` [https://gitter.im/crystal-lang/crystal?at=619b8de842fc2863b2200d64]
<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]
yxhuvud has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 264 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 264 seconds]