3 ms·
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 ht
by andrewmcwatters 3y ago
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 https://en.m.wikipedia.org/wiki/Bell_character
- jswrenn 3y agoIt already exists! https://github.com/cuviper/alloc_geiger https://github.com/cuviper/alloc_geiger
- andrewmcwatters 3y agoHahaha, perfect! Edit: Wow, I love that this does specifically that, too.
- LiamPowell 3y agoNot 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); }
- andrewmcwatters 3y agoThank you for sharing this!