diff runtime/block_alloc.h @ 41:1b86a1ee500a

Added faster allocator for small objects
author Mike Pavone <pavone@retrodev.com>
date Sat, 10 Oct 2009 16:40:50 -0400
parents
children a24eb366195c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/block_alloc.h	Sat Oct 10 16:40:50 2009 -0400
@@ -0,0 +1,13 @@
+#ifndef BLOCK_ALLOC_H_
+#define BLOCK_ALLOC_H_
+
+#ifdef _WIN32
+#define BLOCK_SIZE 1024*16
+#include <windows.h>
+
+#define block_alloc(size)      VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+#define block_free(block,size) VirtualFree(block, size, MEM_RELEASE)
+
+#endif
+
+#endif //BLOCK_ALLOC_H_