Standard setup for writing C inspired by Casey Muratori, Ryan Fleury, Mr. 4th Programmer, and others in the handmade community.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
372 B

  1. #ifndef OS_IMPL_WIN32_CPP
  2. #define OS_IMPL_WIN32_CPP
  3. #include "os.h"
  4. #include "Windows.h"
  5. void *os_alloc(size_t commitSize) {
  6. return VirtualAlloc(NULL, commitSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
  7. }
  8. void os_reserve(void *ptr) {
  9. }
  10. void os_decommit(void *ptr) {
  11. }
  12. void os_free(void *ptr, size_t size) {
  13. VirtualFree(ptr, NULL, MEM_RELEASE);
  14. }
  15. #endif