Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Peter Atashian
    @retep998
    @LeonineKing1199 What happens if you println twice? Does it go from 21 to 29?
    I wonder how much of those 8 allocations are only done the first time you print stuff
    LeonineKing1199
    @LeonineKing1199
    Do you not have Val grins?
    Lol valfrind
    I hate my phone
    Peter Atashian
    @retep998
    I'm on Windows so I can't verify your non-windows specific results
    Vladyslav M.
    @dywedir
    fn main() {
        println!("Hello, world!");
    }
    ==18407== Memcheck, a memory error detector
    ==18407== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
    ==18407== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
    ==18407== Command: ./testt
    ==18407== 
    ==18407== 
    ==18407== HEAP SUMMARY:
    ==18407==     in use at exit: 0 bytes in 0 blocks
    ==18407==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
    ==18407== 
    ==18407== All heap blocks were freed -- no leaks are possible
    ==18407== 
    ==18407== For counts of detected and suppressed errors, rerun with: -v
    ==18407== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    :D
    Peter Atashian
    @retep998
    @N-006 I think your memcheck might be broken :stuck_out_tongue:
    Vladyslav M.
    @dywedir
    @retep998 no, it's ok! :innocent:
    Erik Hedvall
    @Ogeon
    I'm also getting 0 heap usage with rustc 1.10
    ...on Linux
    Lilian Anatolie Moraru
    @lilianmoraru
    0 here too in debug and release mode.
    Peter Atashian
    @retep998
    What happens if you deliberately allocate memory with Vec or String?
    Lilian Anatolie Moraru
    @lilianmoraru
    Same, 0.
    I tried with vec, one sec
    Yep, 0 with both String and Vec
    Lilian Anatolie Moraru
    @lilianmoraru
    @retep998 Cmon, I've ran under valgrind more complex applications like racer and still 0 leaks.
    Vladyslav M.
    @dywedir
    Just add
    #![feature(alloc_system)]
    extern crate alloc_system;
    Lilian Anatolie Moraru
    @lilianmoraru
    That's not from Rust
    I think that's from Dropbox
    And who knows, that allocator might leak intentionally.
    Nvm, I've mistaken with something else

    Yes, using

    #![feature(alloc_system)]
    extern crate alloc_system;

    and Not Rust's allocator, it is leaking...

    But you basically intentionally asked for it to leak in that case
    Lilian Anatolie Moraru
    @lilianmoraru
    Btw, I have mistaken it with this one: https://github.com/dropbox/rust-alloc-no-stdlib
    LeonineKing1199
    @LeonineKing1199
    Oh, that's so interesting.
    All I did was use sudo apt-get install rustc
    I'm on Ubuntu 16.04
    Maybe it's my version of valgrind?
    I'm on 3.11 of that
    Lilian Anatolie Moraru
    @lilianmoraru
    @LeonineKing1199 I also use Valgrind 3.11(which is the newest version) and the way you install Rust does not change the behavior
    Although, the recommended way of installing and using Rust would be through rustup: https://www.rustup.rs/
    LeonineKing1199
    @LeonineKing1199
    Well, I'm thankful to know that I just have a borked build.
    If other people are reporting 0 allocations, that's a good thing.
    Alexander Chepurnoy
    @kushti
    Hi folks! What paper book on Rust can you recommend, if I went through the online book on Rust website, have written some simple programs following it and now want to go deeper?
    Thomas Koehler
    @Bastacyclop
    deeper like Rust internals or as a user ?
    Thomas Koehler
    @Bastacyclop
    I would say that once you've read the official book you will learn the most by practicing and looking at community's code, articles, ...
    https://this-week-in-rust.org/ is great to find interesting stuff
    Thomas Koehler
    @Bastacyclop
    I can't really help you for paper books
    Thomas Koehler
    @Bastacyclop
    there is a lot of stuff here too https://github.com/ctjhoa/rust-learning, but the link is on the official website so you probably know it.
    Bruno Filippone
    @bfil
    Anyone cares for a code review? I’ve just open sourced an event store I’ve built with Rust, here it is: https://github.com/bfil/exar-db
    It would be great to get some feedback from the community!
    Alexander Chepurnoy
    @kushti
    @Bastacyclop thanks for the tips! I actually missed rust-learning :(
    Ingvar Stepanyan
    @RReverser
    Is there any efficient way to implement WeakMaps in Rust? Well, technically it's not WeakMap because Rust doesn't have GC and thus "weak" doesn't make much sense, but what I'm interested in is a way to store extra information on objects with O(1) lookup, where HashMap is not really the best solution.
    Another way of looking into this would be "traits with data members".
    To elaborate a little bit more - I'm going to store information associated with nodes in a tree retrieved from an external crate, so just adding data members is not really an option (without forking that crate just for this purpose); recreating entire tree but with wrappers around each node also seems too expensive (and requires lots of code to handle all kinds of nodes).
    The only approach that seems to allow this so far is defining custom allocator which would reserve extra space on objects, but I'm not sure I want to go down that way and hope for a simpler solution.
    Benjamin Z
    @benjyz
    Hi. noob here. I'm trying to create a sqlite database
    let conn = Connection::open_in_memory().unwrap();
    the doc tells me I can open like this: open<P: AsRef<Path>>(path: P) -> Result<Connection>