by Mankaninen · 8y ago · 0 comments
Trying to minimize the library by pushing work to the application is wrong every time you expect the library to be used more than once. Despite these objections, I like libraries that are free of IO and mallocs!
Mine? Just two functions: dns_encode() and dns_decode(). No I/O. No malloc().
[1] https://github.com/spc476/SPCDNS
[2] The ones I was looking at are written in C.
...by having your own arena allocator! I do agree that it is quite doable in this particular case, but I always remember that a custom memory allocator of OpenSSL made Heartbleed much more devastating.
void bmp_init(void *, long width, long height);