hi all. i have a simple problem which is solved, but I am just seeing if there are any cleaner solutions. given a string move the first 2 characters to the end of the string. in ruby land i would use String#rotate, but i can't seem to find a equivalent in crustal
<Blacksmoke16> interesting use case
<Blacksmoke16> but no, that method doesnt exist in crystal lang
thank you for your invidious work! *so much appreciation*
notzmv has joined #crystal-lang
<naqvis> > *<SamantazFox>* if I do SomeClass.new, when will this GC'd? ⏎ Technically speaking, objects get incrementally GCed when the go out of scope. If you are seeing huge memory usage, that might be symptom of memory leak.
<naqvis> Have you tried using tools like valgrind or similar to do some tracing?
<naqvis> > *<SamantazFox>* One of those recent crashes seem to come from the GC itself: https://bpa.st/6UOA ⏎ ⏎ to get GC issue out of scope, i would say try running your code without GC enabled `-Dgc_none` and see if you encounter similar segfaults. Though i guess you might get OOM instead
<naqvis> Memory leaks are hard to find without using tools or some logging mechanisms to capture the stats
Guest456 has joined #crystal-lang
Guest456 has quit [Client Quit]
Guest58 has joined #crystal-lang
Guest58 has quit [Client Quit]
also note that structs are copied around, not passed by reference, so it is possible to get lots of copies of really large structs without realizing it
hmm crystal has always been good wrt to memory mgmt to me. would also suspect a possible struct (or other) leak