// heap_exports.c - public CRT allocator names // Intentionally includes nothing. MSVC/UCRT headers declare malloc/free with // compiler attributes that conflict with /Gz in this freestanding build. // Keep the real heap implementation in heap.c under private names and expose // only these tiny forwarding thunks here. #ifdef USER_HEAP_EXPORTS #define HEAP_EXPORT __declspec(dllexport) #else #define HEAP_EXPORT #endif typedef unsigned __int64 size_t; void* _malloc(size_t size); void _free(void* ptr); void* _calloc(size_t count, size_t size); void* _realloc(void* ptr, size_t size); HEAP_EXPORT void* malloc(size_t size) { return _malloc(size); } HEAP_EXPORT void free(void* ptr) { _free(ptr); } HEAP_EXPORT void* calloc(size_t count, size_t size) { return _calloc(count, size); } HEAP_EXPORT void* realloc(void* ptr, size_t size) { return _realloc(ptr, size); }