2 ** Copyright 2003-2010, VisualOn, Inc.
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
8 ** http://www.apache.org/licenses/LICENSE-2.0
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
16 /*******************************************************************************
19 Content: memory functions & data structures
21 *******************************************************************************/
28 #endif /* __cplusplus */
34 VO_S32 Size; /*!< Buffer stride */
36 VO_PTR VBuffer; /*!< user data pointer */
37 VO_PTR PBuffer; /*!< user data pointer */
41 typedef struct VO_MEM_OPERATOR
43 VO_U32 (VO_API * Alloc) (VO_S32 uID, VO_MEM_INFO * pMemInfo);
44 VO_U32 (VO_API * Free) (VO_S32 uID, VO_PTR pBuff);
45 VO_U32 (VO_API * Set) (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize);
46 VO_U32 (VO_API * Copy) (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
47 VO_U32 (VO_API * Check) (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize);
48 VO_S32 (VO_API * Compare) (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize);
49 VO_U32 (VO_API * Move) (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
52 #define voMemAlloc(pBuff, pMemOP, ID, nSize) \
54 VO_MEM_INFO voMemInfo; \
55 voMemInfo.Size=nSize; \
56 pMemOP->Alloc(ID, &voMemInfo); \
57 pBuff=(VO_PBYTE)voMemInfo.VBuffer; \
63 #endif /* __cplusplus */