News for hackers. Stuff that matters.
Re:Stupid alloc – what if memory allocation was annoying by andrewmcwatters on Sunday July 09, 2023 @12:14AM (#36651445)
I love it. I’d also like to see a bellalloc which plays the system warning sound on every allocation.[1]

[1]: https://en.m.wikipedia.org/wiki/Bell_character

Re:Stupid alloc – what if memory allocation was annoying by jswrenn on Sunday July 09, 2023 @12:47AM (#36651599)
Re:Stupid alloc – what if memory allocation was annoying by andrewmcwatters on Sunday July 09, 2023 @12:53AM (#36651622)
Hahaha, perfect! Edit: Wow, I love that this does specifically that, too.
Re:Stupid alloc – what if memory allocation was annoying by LiamPowell on Sunday July 09, 2023 @01:55AM (#36651965)
Not Rust, but it's very easy to wrap malloc under gcc for this kind of thing (or something more useful). Compile with --wrap=malloc and:

    void *__real_malloc(size_t);
    void *__wrap_malloc(size_t size) {
        ...
        return __real_malloc(size);
    }
Re:Stupid alloc – what if memory allocation was annoying by andrewmcwatters on Sunday July 09, 2023 @04:04PM (#36658321)
Thank you for sharing this!