diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-04 09:04:36 +0100 | 
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-04 09:04:36 +0100 | 
| commit | f40d07512ab54ba3da38c8a8b92cf0c6d1469bc6 (patch) | |
| tree | f1fbcc8ce2415f1d3c0f36c0411386e093e1be09 /indra/llcommon | |
| parent | dc2f50642bf6c785263d91ca53ec337f3898b990 (diff) | |
finish conversion to ll_aligned_*() wrappers
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/llmemory.h | 30 | 
1 files changed, 26 insertions, 4 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 93dd7a7fe3..1c8c91f57e 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -43,13 +43,9 @@ inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed wi  #else  	void *rtn;  	if (LL_LIKELY(0 == posix_memalign(&rtn, 16, size))) -	{  		return rtn; -	}  	else // bad alignment requested, or out of memory -	{  		return NULL; -	}  #endif  } @@ -64,6 +60,32 @@ inline void ll_aligned_free_16(void *p)  #endif  } +inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed with ll_aligned_free_32(). +{ +#if defined(LL_WINDOWS) +	return _mm_malloc(size, 32); +#elif defined(LL_DARWIN) +# error implement me. +#else +	void *rtn; +	if (LL_LIKELY(0 == posix_memalign(&rtn, 32, size))) +		return rtn; +	else // bad alignment requested, or out of memory +		return NULL; +#endif +} + +inline void ll_aligned_free_32(void *p) +{ +#if defined(LL_WINDOWS) +	_mm_free(p); +#elif defined(LL_DARWIN) +# error implement me. +#else +	free(p); // posix_memalign() is compatible with heap deallocator +#endif +} +  class LL_COMMON_API LLMemory  {  public:  | 
