A C++ library for Windows x64 that removes all CRT dependencies.
Feel free to contribute !
Memory
- Custom Pool Allocator: set to 2 MB (change as prefered)
- Heap: wrapper for
operator new/delete&malloc/free - Direct Syscall: extracts SSNs from ntdll stubs at runtime for
NtDelayExecutionandNtYieldExecution
CRT
vector: growable, push_back, erase & copy/movearray,span: fixed size container and non-owning viewstring: append, substr, find, starts_with & ends_withstring_view: non owning string viewoptional: holds a value or nothing, withnulloptor emptyvariant: tagged union, type safe getfunction: type erased callable with small object optimizationhash: FNV-1a 64-bit for int, uint, long long, pointer & stringunordered_map: hash map, insert, find, contains, erase & operator[]addressof: returns the actual address of an objectsort,find,find_if,min,max&clamp: algorithm helperssqrt,sin,cos,tan,atan2,pow,abs,isfinite: mathprintf: via WriteConsoleA output,%d%u%x%X%p%s%c%f%ll%zmutex,lock_guard: basic mutual exclusion and scoped lockingonce_flag,call_once: https://en.cppreference.com/cpp/thread/call_oncethis_thread::yield: calls NtYieldExecutionthis_thread::sleep_for: calls NtDelayExecutionchrono:nanoseconds,microseconds,milliseconds,seconds,minutes&hours
#define NOMINMAX
#include <windows.h>
#include "memory/heap/heap.h"
#include "syscall/syscall.h"
#include "crt/std.h"
int main()
{
if (!NoUCRT::Initialize()) {
// handle
return false;
}
std::vector<int> vector;
vector.push_back(1);
vector.push_back(2);
std::string string = "hello";
string += " world";
std::printf("vec[0]=%d str=%s sqrt2=%.4f\n", vector[0], string.c_str(), std::sqrt(2.0));
return 0;
}To linker flags add: /NODEFAULTLIB to ofc exclude msvc's libs
Compile Flags
--target=x86_64-pc-windows-msvc
-x
c++
-Ivendor/no-ucrt
-std=c++23
-DWIN32_LEAN_AND_MEAN
-D_CRT_SECURE_NO_WARNINGS
-D_NO_CRT_STDIO_INLINE
-DNOMINMAX
-D_CSTDLIB_
printfoutputs to stdout via WriteConsoleA.- Its suggested to implement your own pool allocator