diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-07-05 11:28:29 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-07-07 17:57:48 -0600 |
| commit | 5865a5ae7bcca7767ea7c8ed4d5e618627b6fe35 (patch) | |
| tree | 4ea85083b16c6855e5bb9e9fd6b6cbcc87334a53 /loader/vk_loader_platform.h | |
| parent | 061c3793c7dbb414e9866c64bed7498239303380 (diff) | |
| download | usermoji-5865a5ae7bcca7767ea7c8ed4d5e618627b6fe35.tar.xz | |
loader: Save app allocation callbacks
Add host memory allocation functions that the
loader can use. Add comments of where these
allocation calls should go. Need to plumb the
instance pointer to some functions to support this.
Diffstat (limited to 'loader/vk_loader_platform.h')
| -rw-r--r-- | loader/vk_loader_platform.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index b60f421f..c763765d 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -151,6 +151,8 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ pthread_cond_broadcast(pCond); } +#define loader_stack_alloc(size) alloca(size) +static inline void *loader_aligned_alloc(size_t alignment, size_t size) { return aligned_alloc(alignment, size); } #elif defined(_WIN32) // defined(__linux__) /* Windows-specific common code: */ @@ -387,6 +389,8 @@ char *loader_get_registry_string(const HKEY hive, #define LeaveCriticalSection PLEASE USE THE loader_platform_thread_unlock_mutex() FUNCTION #define DeleteCriticalSection PLEASE USE THE loader_platform_thread_delete_mutex() FUNCTION +#define loader_stack_alloc(size) _alloca(size) +static inline void *loader_aligned_alloc(size_t alignment, size_t size) { return _aligned_alloc(alignment, size); } #endif // defined(_WIN32) #endif /* LOADER_PLATFORM_H_TEMP */ |
