summaryrefslogtreecommitdiff
path: root/src/os.c
Commit message (Collapse)AuthorAgeFilesLines
* Abstract page allocation and locking in os.cGravatar Michael Smith 28 hours1-4/+40
| | | | Simplifies ac.c just a little bit.
* Do away with memcpy/memset/memcmpGravatar Michael Smith 2026-02-161-1/+17
| | | | | | | | | | | | | | | | | | | | | Now everything is either explicitly a rep thing, or explicitly some other small run of reasonably efficient instructions. No library calls or function call overhead of any kind. Code size remains nice and small. Ban a few other bad libc functions while we're at it. More can be added later if we decide that's a useful idea. This will require some discipline and workarounds to cope with Clang's tendency to shove mem* calls in places you don't want them even when you tell it not to. Well, c'est la vie. I'm a little nervous that the __builtin_memmove() usage in shuntvars() could still one day emit actual library calls. It appears we're not importing memmove() from anywhere at the moment, though. So I guess it's good enough for now. Also I had to get rid of alloca() in con_.c but that was kind of bad anyway, so that's fine.
* Remove years from copyright headersGravatar Michael Smith 2025-04-071-1/+1
| | | | | | | | They're legally unnecessary as far as I know, and kind of annoying to maintain on a long-term basis. This was done with the consent of all 3 other contributors, in case anyone was wondering.
* Use C23 void-argument-free prototypesGravatar Michael Smith 2025-04-061-3/+3
| | | | | | | In the future we can also consider moving to {} instead of {0} for initialisers, but my old Clang (16) doesn't support this, so it might be wise to wait longer on that one so people don't need too bleeding-edge of a compiler just to build this thing.
* Fix a Linux woopsy in os.c I spotted the other dayGravatar Michael Smith 2024-09-081-1/+0
| | | | | | Note: for all I know Linux isn't even compiling right now - I rarely actually test that. But still, might as well fix this since it's an obvious mistake.
* Revise syntax macros and add a ton of branch hintsGravatar Michael Smith 2024-08-231-6/+7
| | | | | | | | | My new programming style is branch hints. All non-confusing branches must be hinted when I can be bothered. It's faster, sometimes, maybe. Also, start trying to use more signed sizes in at least some of the places where it makes sense. Unsigned sizes are surprisingly error-prone!
* Rework OS abstractionsGravatar Michael Smith 2024-08-221-0/+204
| | | | | | | | | | | | | | | | | | | | | | - As much as possible avoid dragging system headers into translation units. This should avoid namespace pollution and, hopefully, speed up builds a little bit. - Avoid leaning on the UCRT so much on Windows - prefer native win32 calls and native file handles except where doing so is inconvenient (in particular, for stat(), which we might try and replace later). - Also, switch from SystemFunction036 to ProcessPrng on Windows. This requires us to generate a stub for bcryptprimitives.dll because Microsoft haven't bothered to provide a link library, but the function is better-documented and seems to be a more direct under-the-hood call as well. Apparently it's what's used by the major web browsers these days, which seems like a good indication it's stable and trusted. - Lastly, remove a bunch of functions and macros and stuff that weren't actually being used. It seems good to try and keep the scope of OS-dependent stuff relatively contained and only add to it when actually required.
* Split up os.h, inline functions and fix some typosGravatar Michael Smith 2021-12-301-56/+0
|
* Initial public snapshotGravatar Michael Smith 2021-11-201-0/+56
With code from Bill. Thanks Bill!