4 ms·
> probably only a few dozen lines of code Classic HN.
by mperham 3y ago
> probably only a few dozen lines of code
Classic HN.
- kragen 3y agoi'm guessing you haven't done it either, so you don't have any basis for guessing whether that's an underestimate or an overestimate 'classic hn' in the negative sense is a one-line dismissal containing no reasoning or information. do better
- techbrovanguard 3y agohi, i’m _reasonably_ familiar with libcs, specifically glibc and musl. even a cursory investigation would reveal how involved these things are. classic hn. do better.
- kragen 3y agoyou can of course make malloc arbitrarily complex, and a simple malloc will not be very efficient, but musl's entire malloc/free implementation is only 600 lines of c (`cloc musl-1.1.24/src/malloc`) and even a fair bit of that is no longer actually used (`#if 1 ... #else ... #endif`) so i don't think a cursory investigation supports your vague innuendo, which seems to be implying that adding thread-local allocation pools to musl would require enormously more than 'a few dozen lines of code', as i said. the entire allocator is 50 dozen lines the code isn't 'involved'; it's nice and straightforward, except for a clever algorithm or two from hacker's delight. what's involved is debugging it when you break it
- intelVISA 3y agoMost Good Things are a few dozen lines of code, don't let the Scrum Master fool you.