Functions for memory management. More...
Functions | |
SIMD_API void * | SimdAllocate (size_t size, size_t align) |
Allocates aligned memory block. More... | |
SIMD_API void | SimdFree (void *ptr) |
Frees aligned memory block. More... | |
SIMD_API size_t | SimdAlign (size_t size, size_t align) |
Gets aligned size. More... | |
SIMD_API size_t | SimdAlignment () |
Gets alignment required for the most productive work of Simd Library. More... | |
SIMD_API void | SimdRelease (void *context) |
Releases context created with using of Simd Library API. More... | |
SIMD_INLINE void | LitterCpuCache (size_t k=2) |
It creates a large buffer and fills it. More... | |
Detailed Description
Functions for memory management.
Function Documentation
◆ SimdAllocate()
void * SimdAllocate | ( | size_t | size, |
size_t | align | ||
) |
Allocates aligned memory block.
- Note
- The memory allocated by this function is must be deleted by function SimdFree.
- Parameters
-
[in] size - a size of memory block. [in] align - a required alignment of memory block.
- Returns
- a pointer to allocated memory.
◆ SimdFree()
void SimdFree | ( | void * | ptr | ) |
Frees aligned memory block.
- Note
- This function frees a memory allocated by function SimdAllocate.
- Parameters
-
[in] ptr - a pointer to the memory to be deleted.
◆ SimdAlign()
size_t SimdAlign | ( | size_t | size, |
size_t | align | ||
) |
Gets aligned size.
- Parameters
-
[in] size - an original size. [in] align - a required alignment.
- Returns
- an aligned size.
◆ SimdAlignment()
size_t SimdAlignment | ( | ) |
Gets alignment required for the most productive work of Simd Library.
- Returns
- a required alignment.
◆ SimdRelease()
void SimdRelease | ( | void * | context | ) |
Releases context created with using of Simd Library API.
- Note
- This function releases a context created by functions SimdDetectionLoadA and SimdDetectionInit.
- Parameters
-
[in] context - a context to be released.
◆ LitterCpuCache()
void LitterCpuCache | ( | size_t | k = 2 | ) |
It creates a large buffer and fills it.
This function litters CPU cache. It is useful for test purposes.
- Parameters
-
[in] k - a boosting coefficient of stub buffer size relative to CPU L3 cache size. Its default value is 2.