3 ms·
In BRL's MUVES project, we used a 2-character prefix indicating category. E.g., all the external identifiers for our fancy memory allocator began with "Mm", wh
by DougGwyn 6y ago
In BRL's MUVES project, we used a 2-character prefix indicating category. E.g., all the external identifiers for our fancy memory allocator began with "Mm", where Mm.h documented the interface for the Mm package only.
To minimize the external identifiers, one could make just the name of a container structure the sole entry access handle, with structure members pointing to the functions. Then use it like:
#include <Mm.h>
if ((new = Mm.allo(size)) == NULL)
Er.abort("out of memory");
- jfkebwjsbx 6y agoTip: you can use four leading spaces to write code. Like this
- deleted 6y ago[deleted]
- steveklabnik 6y agoYou only need two! like this
- DougGwyn 6y agoI tried, but two spaces yielded what you saw.
- dang 6y agoHuh, it also needed an extra line break before the first line of code. I didn't realize that! I've fixed it now.
- DougGwyn 6y agoYou should be commended for the fast customer service!
- steveklabnik 6y agoI didn't realize that either, but it's described in formatdoc as such. So if you changed that behavior, probably should change the docs too.
- dang 6y agoI didn't change the behavior - I just added a newline. Sorry that wasn't clear.
- sgt 6y agoI did not know that, after spending years on HN. while(1) fork();
- steveklabnik 6y agohttps://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc