"A single-file C allocator with explicit heaps and tuning knobs" on the frontpage of HN https://news.ycombinator.com/item?id=47520807

Oh sounds nice and lightweight, good to have more allocator options

Oh wait this is 10k lines long and one commit and this person's first project

Oh look so many parentheses it makes me, a lisper, feel overwhelmed https://github.com/xtellect/spaces/blob/master/spaces.c#L4713

So tired of bumping into slop everywhere

A single-file C allocator with explicit heaps and tuning knobs | Hacker News

spaces/spaces.c at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
spaces/Makefile at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
@puppygirlhornypost2 @cwebber dawg what the fuck
spaces/bench.sh at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
@puppygirlhornypost2 @xan Yeah @vv was looking at it, and pointed out that it downloaded an external benchmark program that wasn't even capable of running against another arbitrary allocator. So basically it isn't doing anything
@cwebber @puppygirlhornypost2 @vv After seeing the copyright dates of 2021-2026, I'm not sure if this is vibe coded or just natural born terrible code

@xan @vv @cwebber can you name a single person who would unironically type the following line:

page->hdr.fs.free = ((char *) ((FSBlock *) (((char *) ((Block *) ((char *) (page) + (((PageSize) ((PageSize) ((PageSize) (sizeof(Page) + (0)) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))))))) - 0))); page->hdr.fs.end = page->hdr.fs.free + (((char *) page + size - page->hdr.fs.free) / (((index) << 3) + ((PageSize) ((PageSize) ((PageSize) (0) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))))) * (((index) << 3) + ((PageSize) ((PageSize) ((PageSize) (0) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))));

@xan @puppygirlhornypost2 @cwebber ​​ i'm not that familiar with c code styles but what what the hecc is this code style. this is so hard to look at

@puniko @xan @puppygirlhornypost2 @cwebber

This is the Anthropic coding style /s

@puniko @xan @cwebber at the very basic what it's doing is arithmetic with different types.

I could see why one would throw a couple C casts in here (iirc C does have some implicit casting, but these are more complex types). The problem is you can literally see things like (char*) [value] which is then casted into another type
(shitass)((char*) [value]) and then cast back to char*. this makes no sense to me with the level of nesting done here.
@puppygirlhornypost2 @xan @cwebber ​​ it certainly is "creative" (for a lack of a better word)
spaces/spaces.c at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub

@puniko @xan @puppygirlhornypost2 @cwebber

{ };
load bearing empty code block?

@Johann150 @xan @puppygirlhornypost2 @cwebber this code certainly does some very bold creative choices ​

@puppygirlhornypost2 @puniko @xan @cwebber eh, i think i've seen that one several times before. i guess because if you're counting characters, this is marginally shorter, albeit less clear

while (true) for (;;)

@Johann150 @puniko @puppygirlhornypost2 @cwebber @xan I'm not sure anyone is counting characters at this point. Or at least trying to keep the count low.
@puppygirlhornypost2 @Johann150 @xan @cwebber to be fair, this is a valid way in C to write a while true loop afaik
@Johann150 @xan @puppygirlhornypost2 @cwebber i think its sometimes written that way to prevent some compilers to yield a warning about the condition being always true or something