Standard setup for writing C inspired by Casey Muratori, Ryan Fleury, Mr. 4th Programmer, and others in the handmade community.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
342 B

  1. #ifndef OS_IMPL_LINUX_CPP
  2. #define OS_IMPL_LINUX_CPP
  3. #include <sys/mman.h>
  4. #include <sys/stat.h>
  5. #include "os.h"
  6. void *os_alloc(size_t capacity) {
  7. return mmap(0, capacity, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  8. }
  9. void os_reserve(void *ptr) {
  10. }
  11. void os_decommit(void *ptr) {
  12. }
  13. void os_free(void *ptr) {
  14. }
  15. #endif