Basic multiline buffer concept

This commit is contained in:
Krzosa Karol
2024-06-20 09:40:05 +02:00
parent b919678913
commit 5539bbd3b9
3 changed files with 253 additions and 4 deletions

View File

@@ -87,6 +87,7 @@ T ClampBottom(T bottom, T b) {
template <class T>
T Clamp(T value, T min, T max) {
Assert(max >= min);
if (value > max) return max;
if (value < min) return min;
return value;
@@ -151,6 +152,7 @@ inline void *AllocSize(Allocator alo, size_t size) {
template <class T>
void Dealloc(Allocator alo, T **p) {
if (*p == NULL) return;
alo.proc(alo.object, AllocatorKind_Deallocate, *p, 0);
*p = NULL;
}