From 6cbc3929a54d37bd23cb5efa8e3320ba02f78b2f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 31 May 2019 17:20:37 -0400 Subject: Use slang- prefix on slang compiler and core source (#973) * Prefixing source files in source/slang with slang- * Prefix source in source/slang with slang- prefix. * Rename core source files with slang- prefix. * Update project files. * Fix problems from automatic merge. --- source/core/allocator.h | 64 ------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 source/core/allocator.h (limited to 'source/core/allocator.h') diff --git a/source/core/allocator.h b/source/core/allocator.h deleted file mode 100644 index 5832d0b84..000000000 --- a/source/core/allocator.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef CORE_LIB_ALLOCATOR_H -#define CORE_LIB_ALLOCATOR_H - -#include -#ifdef _MSC_VER -# include -#endif - -namespace Slang -{ - inline void* alignedAllocate(size_t size, size_t alignment) - { -#ifdef _MSC_VER - return _aligned_malloc(size, alignment); -#elif defined(__CYGWIN__) - return aligned_alloc(alignment, size); -#else - void * rs = 0; - int succ = posix_memalign(&rs, alignment, size); - if (succ!=0) - rs = 0; - return rs; -#endif - } - - inline void alignedDeallocate(void* ptr) - { -#ifdef _MSC_VER - _aligned_free(ptr); -#else - free(ptr); -#endif - } - - class StandardAllocator - { - public: - // not really called - void* allocate(size_t size) - { - return ::malloc(size); - } - void deallocate(void * ptr) - { - return ::free(ptr); - } - }; - - template - class AlignedAllocator - { - public: - void* allocate(size_t size) - { - return alignedAllocate(size, ALIGNMENT); - } - void deallocate(void * ptr) - { - return alignedDeallocate(ptr); - } - }; -} - -#endif -- cgit v1.2.3