#subsky — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #subsky, aggregated by home.social.
-
RE: https://fosstodon.org/@golemwire/115075076162218775
I'm starting a Fluxer (Discord alternative) group for my #SubSky computing environment :D
Invite link: https://fluxer.gg/I2P03SBv
-
#Programming tip: if you want to allocate memory and explicitly tell the kernel you don't want the memory backed until you use it, try mmap(). Really useful.
An example of mmap being used this way. https://gitlab.com/golemwire/subsky/-/blob/master/cpu/util.c?ref_type=heads#L59 (permalink https://gitlab.com/golemwire/subsky/-/blob/0559e32da1e61eb6b50cdd30f080964a603251b4/cpu/util.c#L59 )
This is from my #SubSky emulator.(p_cpu->p_memory = (uint8_t *) mmap(NULL, (size_t) 1 << 32, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0))
-
#Programming tip: if you want to allocate memory and explicitly tell the kernel you don't want the memory backed until you use it, try mmap(). Really useful.
An example of mmap being used this way. https://gitlab.com/golemwire/subsky/-/blob/master/cpu/util.c?ref_type=heads#L59 (permalink https://gitlab.com/golemwire/subsky/-/blob/0559e32da1e61eb6b50cdd30f080964a603251b4/cpu/util.c#L59 )
This is from my #SubSky emulator.(p_cpu->p_memory = (uint8_t *) mmap(NULL, (size_t) 1 << 32, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0))