summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-26 16:29:27 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-02-27 21:19:36 -0500
commit03f7a342011a4f69cfcbec7af3e4f1a2e835618b (patch)
tree8e11d1f162ed3908e007c9bdf1fc1b6952960d83 /include
parent6ef6dd0122b8e44d8547ec31f40def42173e4e41 (diff)
Ensure that numeric array storage is aligned to 256-byte boundary.
OpenCL devices require this else we would get a performance hit. Change-Id: I6b1db6320fa84f933b6446022a0fd02ba267bf21
Diffstat (limited to 'include')
-rw-r--r--include/rtl/alloc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/rtl/alloc.h b/include/rtl/alloc.h
index 9d0b44e862b1..f3459bac3e42 100644
--- a/include/rtl/alloc.h
+++ b/include/rtl/alloc.h
@@ -96,6 +96,30 @@ SAL_DLLPUBLIC void SAL_CALL rtl_freeZeroMemory (
) SAL_THROW_EXTERN_C();
+/** Allocate memory.
+
+ A call to this function will return NULL upon the requested
+ memory size being either zero or larger than currently allocatable.
+
+ @param Alignment alignment in bytes.
+ @param Bytes [in] memory size.
+ @return pointer to allocated memory.
+ */
+SAL_DLLPUBLIC void* SAL_CALL rtl_allocateAlinedMemory (
+ sal_Size Alignment,
+ sal_Size Bytes
+) SAL_THROW_EXTERN_C();
+
+
+/** Free memory allocated with rtl_allocateAlinedMemory.
+ @param Ptr [in] pointer to previously allocated memory.
+ @return none. Memory is released. Ptr is invalid.
+ */
+SAL_DLLPUBLIC void SAL_CALL rtl_freeAlignedMemory (
+ void * Ptr
+) SAL_THROW_EXTERN_C();
+
+
/** Opaque rtl_arena_type.
*/
typedef struct rtl_arena_st rtl_arena_type;