mirror of
https://github.com/Ed94/metadesk.git
synced 2026-07-13 21:11:26 -07:00
various progress
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "arena.h"
|
||||
#endif
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "macros.h"
|
||||
# include "base_types.h"
|
||||
@@ -63,20 +63,20 @@ internal Arena* arena_alloc_(ArenaParams *params);
|
||||
internal void arena_release(Arena *arena);
|
||||
|
||||
//- rjf: arena push/pop/pos core functions
|
||||
internal void *arena_push(Arena *arena, U64 size, U64 align);
|
||||
internal U64 arena_pos(Arena *arena);
|
||||
internal void *arena_push (Arena *arena, U64 size, U64 align);
|
||||
internal U64 arena_pos (Arena *arena);
|
||||
internal void arena_pop_to(Arena *arena, U64 pos);
|
||||
|
||||
//- rjf: arena push/pop helpers
|
||||
internal void arena_clear(Arena *arena);
|
||||
internal void arena_pop(Arena *arena, U64 amt);
|
||||
internal void arena_pop (Arena *arena, U64 amt);
|
||||
|
||||
//- rjf: temporary arena scopes
|
||||
internal TempArena temp_arena_begin(Arena *arena);
|
||||
internal void temp_arena_end(TempArena temp);
|
||||
|
||||
//- rjf: push helper macros
|
||||
#define push_array_no_zero_aligned(a, T, c, align) (T *)arena_push((a), sizeof(T)*(c), (align))
|
||||
#define push_array_aligned(a, T, c, align) (T *)memory_zero(push_array_no_zero_aligned(a, T, c, align), sizeof(T)*(c))
|
||||
#define push_array_no_zero_aligned(a, T, c, align) (T *)arena_push((a), sizeof(T) * (c), (align))
|
||||
#define push_array_aligned(a, T, c, align) (T *)memory_zero(push_array_no_zero_aligned(a, T, c, align), sizeof(T) * (c))
|
||||
#define push_array_no_zero(a, T, c) push_array_no_zero_aligned(a, T, c, max(8, align_of(T)))
|
||||
#define push_array(a, T, c) push_array_aligned(a, T, c, max(8, align_of(T)))
|
||||
#define push_array(a, T, c) push_array_aligned (a, T, c, max(8, align_of(T)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# include "command_line.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "strings.h"
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# include "entry_point.h"
|
||||
# include "arena.h"
|
||||
# include "thread_context.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
#endif
|
||||
@@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef global // Global variables
|
||||
# ifdef MD_DYN_EXPORT
|
||||
# if defined(MD_DYN_EXPORT) || defined(MD_STATIC_LINK)
|
||||
# define global
|
||||
# else
|
||||
# define global static
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "base_types.h"
|
||||
# include "strings.h"
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
#if MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
@@ -23,8 +23,8 @@
|
||||
# define expect(expr, val) (expr)
|
||||
#endif
|
||||
|
||||
#define likely(expr) expect(expr,1)
|
||||
#define unlikely(expr) expect(expr,0)
|
||||
#define likely(expr) expect(expr, 1)
|
||||
#define unlikely(expr) expect(expr, 0)
|
||||
|
||||
////////////////////////////////
|
||||
//~ erg: type casting
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# include "markup.h"
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "linkage.h"
|
||||
# include "strings.h"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
|
||||
+112
-82
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
@@ -112,12 +112,6 @@
|
||||
//~ rjf: Atomic Operations
|
||||
|
||||
#if MD_OS_WINDOWS
|
||||
|
||||
// # include <windows.h>
|
||||
// # include <tmmintrin.h>
|
||||
// # include <wmmintrin.h>
|
||||
// # include <intrin.h>
|
||||
|
||||
# if MD_ARCH_X64
|
||||
# define ins_atomic_u64_eval(x) InterlockedAdd64((volatile __int64 *)(x), 0)
|
||||
# define ins_atomic_u64_inc_eval(x) InterlockedIncrement64((volatile __int64 *)(x))
|
||||
@@ -146,16 +140,19 @@
|
||||
//~ rjf: Linked List Building Macros
|
||||
|
||||
//- rjf: linked list macro helpers
|
||||
|
||||
#define check_nil(nil,p) ((p) == 0 || (p) == nil)
|
||||
#define set_nil(nil,p) ((p) = nil)
|
||||
|
||||
//- rjf: doubly-linked-lists
|
||||
|
||||
// insert next-previous with nil
|
||||
#define dll_insert_npz(nil, f, l, p, n, next, prev) ( \
|
||||
check_nil(nil, f) ? ( \
|
||||
(f) = (l) = (n), \
|
||||
set_nil(nil, (n)->next), \
|
||||
set_nil(nil, (n)->prev) \
|
||||
) \
|
||||
(f) = (l) = (n), \
|
||||
set_nil(nil, (n)->next), \
|
||||
set_nil(nil, (n)->prev) \
|
||||
) \
|
||||
: ( \
|
||||
check_nil(nil,p) ? ( \
|
||||
(n)->next = (f), \
|
||||
@@ -164,11 +161,11 @@
|
||||
set_nil(nil,(n)->prev) \
|
||||
) \
|
||||
: ((p) == (l)) ? ( \
|
||||
(l)->next = (n), \
|
||||
(n)->prev = (l), \
|
||||
(l) = (n), \
|
||||
set_nil(nil, (n)->next) \
|
||||
) \
|
||||
(l)->next = (n), \
|
||||
(n)->prev = (l), \
|
||||
(l) = (n), \
|
||||
set_nil(nil, (n)->next) \
|
||||
) \
|
||||
: ( \
|
||||
( \
|
||||
( ! check_nil(nil, p) && check_nil(nil, (p)->next) ) ? \
|
||||
@@ -180,83 +177,116 @@
|
||||
((n)->prev = (p)) \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
|
||||
)
|
||||
// push-back next-previous with nil
|
||||
#define dll_push_back_npz(nil, f, l, n, next, prev) dll_insert_npz(nil, f, l, l, n, next, prev)
|
||||
// push-fornt next-previous with nil
|
||||
#define dll_push_front_npz(nil, f, l, n, next, prev) dll_insert_npz(nil, l, f, f, n, prev, next)
|
||||
#define dll_remove_npz(nil,f,l,n,next,prev) \
|
||||
( \
|
||||
( \
|
||||
(n) == (f) ? \
|
||||
(f) = (n)->next \
|
||||
: (0) \
|
||||
), \
|
||||
( \
|
||||
(n) == (l) ? \
|
||||
(l) = (l)->prev \
|
||||
: (0) \
|
||||
), \
|
||||
( \
|
||||
CheckNil(nil,(n)->prev) ? \
|
||||
(0) \
|
||||
: ((n)->prev->next = (n)->next) \
|
||||
), \
|
||||
( \
|
||||
CheckNil(nil,(n)->next) ? \
|
||||
(0) \
|
||||
: ((n)->next->prev = (n)->prev) \
|
||||
) \
|
||||
// remove next-previous with nil
|
||||
#define dll_remove_npz(nil, f, l, n, next, prev) \
|
||||
( \
|
||||
( \
|
||||
(n) == (f) ? \
|
||||
(f) = (n)->next \
|
||||
: (0) \
|
||||
), \
|
||||
( \
|
||||
(n) == (l) ? \
|
||||
(l) = (l)->prev \
|
||||
: (0) \
|
||||
), \
|
||||
( \
|
||||
check_nil(nil,(n)->prev) ? \
|
||||
(0) \
|
||||
: ((n)->prev->next = (n)->next) \
|
||||
), \
|
||||
( \
|
||||
check_nil(nil,(n)->next) ? \
|
||||
(0) \
|
||||
: ((n)->next->prev = (n)->prev) \
|
||||
) \
|
||||
)
|
||||
|
||||
//- rjf: singly-linked, doubly-headed lists (queues)
|
||||
#define SLLQueuePush_NZ(nil,f,l,n,next) ( \
|
||||
CheckNil(nil,f)?\
|
||||
((f)=(l)=(n),SetNil(nil,(n)->next)):\
|
||||
((l)->next=(n),(l)=(n),SetNil(nil,(n)->next)))
|
||||
#define SLLQueuePushFront_NZ(nil,f,l,n,next) (CheckNil(nil,f)?\
|
||||
((f)=(l)=(n),SetNil(nil,(n)->next)):\
|
||||
((n)->next=(f),(f)=(n)))
|
||||
#define SLLQueuePop_NZ(nil,f,l,next) ((f)==(l)?\
|
||||
(SetNil(nil,f),SetNil(nil,l)):\
|
||||
((f)=(f)->next))
|
||||
|
||||
// queue-push next with nil
|
||||
#define sll_queue_push_nz(nil, f, l, n, next) \
|
||||
( \
|
||||
check_nil(nil, f) ? ( \
|
||||
(f) = (l) = (n), \
|
||||
set_nil(nil, (n)->next) \
|
||||
) \
|
||||
: ( \
|
||||
(l)->next=(n), \
|
||||
(l) = (n), \
|
||||
set_nil(nil,(n)->next) \
|
||||
) \
|
||||
)
|
||||
// queue-push-front next with nil
|
||||
#define sll_queue_push_front_nz(nil, f, l, n, next) \
|
||||
( \
|
||||
check_nil(nil, f) ? ( \
|
||||
(f) = (l) = (n), \
|
||||
set_nil(nil,(n)->next) \
|
||||
) \
|
||||
: ( \
|
||||
(n)->next = (f), \
|
||||
(f) = (n) \
|
||||
) \
|
||||
)
|
||||
// queue-pop next with nil
|
||||
#define sll_queue_pop_nz(nil, f, l, next) \
|
||||
( \
|
||||
(f) == (l) ? ( \
|
||||
set_nil(nil,f), \
|
||||
set_nil(nil,l) \
|
||||
) \
|
||||
: ( \
|
||||
(f)=(f)->next \
|
||||
) \
|
||||
)
|
||||
|
||||
//- rjf: singly-linked, singly-headed lists (stacks)
|
||||
|
||||
#define sll_stack_push_n(f,n,next) ( (n)->next = (f), (f) = (n) )
|
||||
#define sll_stack_pop_n(f,next) ( (f) = (f)->next )
|
||||
|
||||
//- rjf: doubly-linked-list helpers
|
||||
#define dll_insert_np(f, l, p, n, next, prev) DLLInsert_NPZ (0, f, l, p, n, next, prev)
|
||||
#define dll_push_back_np(f, l, n, next, prev) DLLPushBack_NPZ (0, f, l, n, next, prev)
|
||||
#define dll_push_front_np(f, l, n, next, prev) DLLPushFront_NPZ(0, f, l, n, next, prev)
|
||||
#define dll_remove_np(f, l, n, next, prev) DLLRemove_NPZ (0, f, l, n, next, prev)
|
||||
#define dll_insert(f, l, p, n) DLLInsert_NPZ (0, f, l, p, n, next, prev)
|
||||
#define dll_push_back(f, l, n) DLLPushBack_NPZ (0, f, l, n, next, prev)
|
||||
#define dll_push_front(f, l, n) DLLPushFront_NPZ(0, f, l, n, next, prev)
|
||||
#define dll_remove(f, l, n) DLLRemove_NPZ (0, f, l, n, next, prev)
|
||||
|
||||
#define dll_insert_np(f, l, p, n, next, prev) dll_insert_npz (0, f, l, p, n, next, prev)
|
||||
#define dll_push_back_np(f, l, n, next, prev) dll_push_back_npz (0, f, l, n, next, prev)
|
||||
#define dll_push_front_np(f, l, n, next, prev) dll_push_front_npz(0, f, l, n, next, prev)
|
||||
#define dll_remove_np(f, l, n, next, prev) dll_remove_npz (0, f, l, n, next, prev)
|
||||
#define dll_insert(f, l, p, n) dll_insert_npz (0, f, l, p, n, next, prev)
|
||||
#define dll_push_back(f, l, n) dll_push_back_npz (0, f, l, n, next, prev)
|
||||
#define dll_push_front(f, l, n) dll_push_front_npz(0, f, l, n, next, prev)
|
||||
#define dll_remove(f, l, n) dll_remove_npz (0, f, l, n, next, prev)
|
||||
|
||||
//- rjf: singly-linked, doubly-headed list helpers
|
||||
#define SLLQueuePush_N(f,l,n,next) SLLQueuePush_NZ(0,f,l,n,next)
|
||||
#define SLLQueuePushFront_N(f,l,n,next) SLLQueuePushFront_NZ(0,f,l,n,next)
|
||||
#define SLLQueuePop_N(f,l,next) SLLQueuePop_NZ(0,f,l,next)
|
||||
#define SLLQueuePush(f,l,n) SLLQueuePush_NZ(0,f,l,n,next)
|
||||
#define SLLQueuePushFront(f,l,n) SLLQueuePushFront_NZ(0,f,l,n,next)
|
||||
#define SLLQueuePop(f,l) SLLQueuePop_NZ(0,f,l,next)
|
||||
|
||||
#define sll_queue_push_n(f, l, n, next) sll_queue_push_nz (0, f, l, n, next)
|
||||
#define sll_queue_push_fornt_n(f, l, n, next) sll_queue_push_front_nz(0, f, l, n, next)
|
||||
#define sll_queue_pop_n(f, l, next) sll_queue_pop_nzs (0, f, l, next)
|
||||
#define sll_queue_push(f, l, n) sll_queue_push_nz (0, f, l, n, next)
|
||||
#define sll_queue_push_front(f, l ,n) sll_queue_push_front_nz(0, f, l, n, next)
|
||||
#define sll_queue_pop(f, l) sll_queue_pop_nz (0, f, l, next)
|
||||
|
||||
//- rjf: singly-linked, singly-headed list helpers
|
||||
#define SLLStackPush(f,n) SLLStackPush_N(f,n,next)
|
||||
#define SLLStackPop(f) SLLStackPop_N(f,next)
|
||||
|
||||
#define sll_stack_push(f, n) sll_stack_push_n(f, n, next)
|
||||
#define sll_stack_pop(f) sll_stack_pop_n (f, next)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Address Sanitizer Markup
|
||||
|
||||
#if COMPILER_MSVC
|
||||
#if MD_COMPILER_MSVC
|
||||
# if defined(__SANITIZE_ADDRESS__)
|
||||
# define ASAN_ENABLED 1
|
||||
# define NO_ASAN __declspec(no_sanitize_address)
|
||||
# else
|
||||
# define NO_ASAN
|
||||
# endif
|
||||
#elif COMPILER_CLANG
|
||||
#elif MD_COMPILER_CLANG
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
|
||||
# define ASAN_ENABLED 1
|
||||
@@ -272,18 +302,18 @@
|
||||
MD_C_API void __asan_poison_memory_region(void const volatile *addr, size_t size);
|
||||
MD_C_API void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
|
||||
|
||||
# define AsanPoisonMemoryRegion(addr, size) __asan_poison_memory_region((addr), (size))
|
||||
# define AsanUnpoisonMemoryRegion(addr, size) __asan_unpoison_memory_region((addr), (size))
|
||||
# define asan_poison_memory_region(addr, size) __asan_poison_memory_region((addr), (size))
|
||||
# define asan_unpoison_memory_region(addr, size) __asan_unpoison_memory_region((addr), (size))
|
||||
#else
|
||||
# define AsanPoisonMemoryRegion(addr, size) ((void)(addr), (void)(size))
|
||||
# define AsanUnpoisonMemoryRegion(addr, size) ((void)(addr), (void)(size))
|
||||
# define asan_poison_memory_region(addr, size) ((void)(addr), (void)(size))
|
||||
# define asan_unpoison_memory_region(addr, size) ((void)(addr), (void)(size))
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Misc. Helper Macros
|
||||
|
||||
#define stringify_(S) #S
|
||||
#define stringify(S) Stringify_(S)
|
||||
#define stringify(S) stringify_(S)
|
||||
|
||||
#define glue_(A,B) A ## B
|
||||
#define glue(A,B) glue_(A,B)
|
||||
@@ -304,22 +334,22 @@
|
||||
|
||||
#define ptr_from_int(i) (void*)((U8*)0 + (i))
|
||||
|
||||
#define Compose64Bit(a,b) ((((U64)a) << 32) | ((U64)b));
|
||||
#define AlignPow2(x,b) (((x) + (b) - 1)&(~((b) - 1)))
|
||||
#define AlignDownPow2(x,b) ((x)&(~((b) - 1)))
|
||||
#define AlignPadPow2(x,b) ((0-(x)) & ((b) - 1))
|
||||
#define IsPow2(x) ((x)!=0 && ((x)&((x)-1))==0)
|
||||
#define IsPow2OrZero(x) ((((x) - 1)&(x)) == 0)
|
||||
#define compose_64bit(a,b) ((((U64)a) << 32) | ((U64)b));
|
||||
#define align_pow_2(x,b) (((x) + (b) - 1)&( ~((b) - 1)))
|
||||
#define align_down_pow_2(x,b) ((x) & (~((b) - 1)))
|
||||
#define align_pad_pow_2(x,b) ((0-(x)) & ((b) - 1))
|
||||
#define is_pow_2(x) ((x) != 0 && ((x )& ((x) - 1)) == 0)
|
||||
#define is_pow_2_or_zero(x) ((((x) - 1) & (x)) == 0)
|
||||
|
||||
#define ExtractBit(word, idx) (((word) >> (idx)) & 1)
|
||||
#define extract_bit(word, idx) (((word) >> (idx)) & 1)
|
||||
|
||||
#if LANG_CPP
|
||||
#if MD_LANG_CPP
|
||||
# define zero_struct {}
|
||||
#else
|
||||
# define zero_struct {0}
|
||||
#endif
|
||||
|
||||
#if COMPILER_MSVC && COMPILER_MSVC_YEAR < 2015
|
||||
#if MD_COMPILER_MSVC && MD_COMPILER_MSVC_YEAR < 2015
|
||||
# define this_function_name "unknown"
|
||||
#else
|
||||
# define this_function_name __func__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
@@ -22,19 +22,20 @@
|
||||
#define MD__HAS_ZERO( x ) ( ( ( x ) - MD__ONES ) & ~( x ) & MD__HIGHS )
|
||||
|
||||
#if MD_COMPILER_MSVC || (MD_COMPILER_CLANG && MD_OS_WINDOWS)
|
||||
# pragma section(".rdata$", read)
|
||||
# define read_only __declspec(allocate(".rdata$"))
|
||||
# pragma section(".rdata$", read)
|
||||
# define read_only __declspec(allocate(".rdata$"))
|
||||
#elif (MD_COMPILER_CLANG && MD_OS_LINUX)
|
||||
# define read_only __attribute__((section(".rodata")))
|
||||
# define read_only __attribute__((section(".rodata")))
|
||||
#else
|
||||
// NOTE(rjf): I don't know of a useful way to do this in GCC land.
|
||||
// __attribute__((section(".rodata"))) looked promising, but it introduces a
|
||||
// strange warning about malformed section attributes, and it doesn't look
|
||||
// like writing to that section reliably produces access violations, strangely
|
||||
// enough. (It does on Clang)
|
||||
# define read_only
|
||||
# define read_only
|
||||
#endif
|
||||
|
||||
typedef U32 AllocType;
|
||||
enum AllocType enum_underlying(U32)
|
||||
{
|
||||
EAllocType_ALLOC,
|
||||
@@ -42,10 +43,10 @@ enum AllocType enum_underlying(U32)
|
||||
EAllocType_FREE_ALL,
|
||||
EAllocType_RESIZE,
|
||||
};
|
||||
typedef U32 AllocType;
|
||||
|
||||
typedef void*(AllocatorProc)( void* allocator_data, AllocType type, SSIZE size, SSIZE alignment, void* old_memory, SSIZE old_size, U64 flags );
|
||||
|
||||
typedef struct AllocatorInfo;
|
||||
struct AllocatorInfo
|
||||
{
|
||||
AllocatorProc* proc;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
#endif
|
||||
|
||||
// C++ namespace support
|
||||
#if MD_DONT_USE_NAMESPACE || MD_LANG_C
|
||||
# if MD_COMPILER_C
|
||||
#if defined(MD_DONT_USE_NAMESPACE) || MD_LANG_C
|
||||
# if MD_LANG_C
|
||||
# define MD_NS
|
||||
# define MD_NS_BEGIN
|
||||
# define MD_NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "platform.h"
|
||||
#endif
|
||||
|
||||
+17
-1
@@ -1,4 +1,4 @@
|
||||
#if MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
@@ -10,6 +10,22 @@
|
||||
|
||||
#if defined( MD_OS_WINDOWS )
|
||||
# include <intrin.h>
|
||||
# include <tmmintrin.h>
|
||||
# include <wmmintrin.h>
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
#
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_MEAN_AND_LEAN
|
||||
# define VC_EXTRALEAN
|
||||
# include <Windows.h>
|
||||
# endif
|
||||
# undef NOMINMAX
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# undef WIN32_MEAN_AND_LEAN
|
||||
# undef VC_EXTRALEAN
|
||||
#endif
|
||||
|
||||
#if MD_LANG_C
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "math.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
@@ -58,5 +57,4 @@ typedef enum Dir2
|
||||
Dir2;
|
||||
|
||||
#define axis2_from_dir2(d) (((d) & 1) ? Axis2_Y : Axis2_X)
|
||||
#define side_from_dir2(d) (((d) < Dir2_Right) ? Side_Min : Side_Max)
|
||||
|
||||
#define side_from_dir2(d) (((d) < Dir2_Right) ? Side_Min : Side_Max)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "base/strings.h"
|
||||
#endif
|
||||
|
||||
+30
-31
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "context_cracking.h"
|
||||
# include "linkage.h"
|
||||
@@ -7,6 +7,7 @@
|
||||
# include "base_types.h"
|
||||
# include "constants.h"
|
||||
# include "math.h"
|
||||
# include "space.h"
|
||||
# include "thread_context.h"
|
||||
# include "memory.h"
|
||||
# include "arena.h"
|
||||
@@ -27,22 +28,22 @@
|
||||
typedef struct String8 String8;
|
||||
struct String8
|
||||
{
|
||||
U8 *str;
|
||||
U64 size;
|
||||
U8 *str;
|
||||
U64 size;
|
||||
};
|
||||
|
||||
typedef struct String16 String16;
|
||||
struct String16
|
||||
{
|
||||
U16 *str;
|
||||
U64 size;
|
||||
U16 *str;
|
||||
U64 size;
|
||||
};
|
||||
|
||||
typedef struct String32 String32;
|
||||
struct String32
|
||||
{
|
||||
U32 *str;
|
||||
U64 size;
|
||||
U32 *str;
|
||||
U64 size;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -51,31 +52,31 @@ struct String32
|
||||
typedef struct String8Node String8Node;
|
||||
struct String8Node
|
||||
{
|
||||
String8Node *next;
|
||||
String8 string;
|
||||
String8Node *next;
|
||||
String8 string;
|
||||
};
|
||||
|
||||
typedef struct String8MetaNode String8MetaNode;
|
||||
struct String8MetaNode
|
||||
{
|
||||
String8MetaNode *next;
|
||||
String8Node *node;
|
||||
String8MetaNode *next;
|
||||
String8Node *node;
|
||||
};
|
||||
|
||||
typedef struct String8List String8List;
|
||||
struct String8List
|
||||
{
|
||||
String8Node *first;
|
||||
String8Node *last;
|
||||
U64 node_count;
|
||||
U64 total_size;
|
||||
String8Node *first;
|
||||
String8Node *last;
|
||||
U64 node_count;
|
||||
U64 total_size;
|
||||
};
|
||||
|
||||
typedef struct String8Array String8Array;
|
||||
struct String8Array
|
||||
{
|
||||
String8 *v;
|
||||
U64 count;
|
||||
String8 *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -114,9 +115,9 @@ PathStyle;
|
||||
typedef struct StringJoin StringJoin;
|
||||
struct StringJoin
|
||||
{
|
||||
String8 pre;
|
||||
String8 sep;
|
||||
String8 post;
|
||||
String8 pre;
|
||||
String8 sep;
|
||||
String8 post;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -125,8 +126,8 @@ struct StringJoin
|
||||
typedef struct UnicodeDecode UnicodeDecode;
|
||||
struct UnicodeDecode
|
||||
{
|
||||
U32 inc;
|
||||
U32 codepoint;
|
||||
U32 inc;
|
||||
U32 codepoint;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -135,18 +136,18 @@ struct UnicodeDecode
|
||||
typedef struct FuzzyMatchRangeNode FuzzyMatchRangeNode;
|
||||
struct FuzzyMatchRangeNode
|
||||
{
|
||||
FuzzyMatchRangeNode *next;
|
||||
Rng1U64 range;
|
||||
FuzzyMatchRangeNode *next;
|
||||
Rng1U64 range;
|
||||
};
|
||||
|
||||
typedef struct FuzzyMatchRangeList FuzzyMatchRangeList;
|
||||
struct FuzzyMatchRangeList
|
||||
{
|
||||
FuzzyMatchRangeNode *first;
|
||||
FuzzyMatchRangeNode *last;
|
||||
U64 count;
|
||||
U64 needle_part_count;
|
||||
U64 total_dim;
|
||||
FuzzyMatchRangeNode *first;
|
||||
FuzzyMatchRangeNode *last;
|
||||
U64 count;
|
||||
U64 needle_part_count;
|
||||
U64 total_dim;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -331,8 +332,6 @@ internal String8 string_from_elapsed_time (Arena* arena, DateTime dt);
|
||||
|
||||
internal String8 indented_from_string(Arena *arena, String8 string);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: String <-> Color
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#include "text.h"
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "linkage.h"
|
||||
# include "strings.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "linkage.h"
|
||||
# include "base_types.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#include "toolchain.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
@@ -35,4 +35,3 @@ typedef enum Compiler
|
||||
Compiler_COUNT,
|
||||
}
|
||||
Compiler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "base/memory.h"
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#include "mdesk.h"
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#if MD_INTELLISENSE_DIRECTIVES
|
||||
#if INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "base/base_types.h"
|
||||
#include "base/math.h"
|
||||
|
||||
+5
-1
@@ -15,9 +15,13 @@
|
||||
MD_NS_BEGIN
|
||||
|
||||
#include "base/base_types.h"
|
||||
#include "base/memory_substrate.h"
|
||||
#include "base/memory.h"
|
||||
#include "base/memory_substrate.h"
|
||||
#include "base/arena.h"
|
||||
#include "base/space.h"
|
||||
#include "base/toolchain.h"
|
||||
#include "base/strings.h"
|
||||
#include "base/text.h"
|
||||
|
||||
MD_NS_END
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "base/macros.h"
|
||||
#include "base/base_types.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef MD_INTELLISENSE_DIRECTIVES
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "base/cracking_arch.h"
|
||||
# include "base/cracking_compiler.h"
|
||||
|
||||
Reference in New Issue
Block a user