Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
1–10 of 25 posts
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#2Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#3I feel like https://github.com/oven-sh/WebKit/commit/35315978baee84ed1bd... is the more interesting commit tbh
yikes
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#4Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#5I feel like https://github.com/oven-sh/WebKit/commit/35315978baee84ed1bd... is the more interesting commit tbh
> p = (char*)""; yikes
I wonder what is the advantage of doing this? Maybe to make sure that p is an actual pointer, so later code can just make that assumption.
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#6Earlier quoted context omitted.
> p = (char*)""; yikes
I thought that was a typo or the forum software removed something, but no - it's a pointer to an empty string literal. If I understand how that works, this creates a null byte (in the read-only memory section of the compiled output?) and points to it. Before this line it checks if p is NULL. I wonder what is the advantage of doing this? Maybe to make sure that p is an actual pointer, so later code can just make that…
Or put another way, it tightens the API/contract of that chunk of code to always return a valid string.
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#7Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#8Something from the PR description that I had to look up to understand: "WTF" is "WebKit Template Framework".
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#9Earlier quoted context omitted.
I thought that was a typo or the forum software removed something, but no - it's a pointer to an empty string literal. If I understand how that works, this creates a null byte (in the read-only memory section of the compiled output?) and points to it. Before this line it checks if p is NULL. I wonder what is the advantage of doing this? Maybe to make sure that p is an actual pointer, so later code can just make that…
Yeah, it simplifies later code, and is safer in the face of future changes. Or put another way, it tightens the API/contract of that chunk of code to always return a valid string.
Re: Bun: cgroup-aware AvailableParallelism / HardwareConcurrency on Linux
#10Something from the PR description that I had to look up to understand: "WTF" is "WebKit Template Framework".
WTF is just kinda funny. Seen it used in loggers too log.wtf("this should never happen")