1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 #ifndef ARBT_MEM_H_INCLUDED 19 #define ARBT_MEM_H_INCLUDED 20 21 #include "arbt_types.h" 22 23 #define ARBTMemSizeT size_t 24 25 #define arbt_memcpy(dest, src, count) memcpy((void *)(dest), (const void *)(src), (ARBTMemSizeT)(count)) 26 #define arbt_memset(dest, ch, count) memset((void *)(dest), (unsigned char)(ch), (ARBTMemSizeT)(count)) 27 #define arbt_memmove(dest, src, bytecount) memmove((void *)(dest), (const void *)(src), (ARBTMemSizeT)(bytecount)) 28 #define arbt_memcmp(buf1, buf2, count) memcmp( (const void *)(buf1), (const void *)(buf2), (ARBTMemSizeT)(count)) 29 #define arbt_malloc(size) malloc((ARBTMemSizeT)(size)) 30 #define arbt_free(memblock) free((void *)(memblock)) 31 #define ARBT_ARRAY_DELETE(ptr) delete [] ptr 32 #define ARBT_ARRAY_NEW(T, count) new T[count] 33 #define ARBT_DELETE(memblock) delete memblock 34 #define ARBT_NEW(arg) new arg 35 36 #endif // ARBT_MEM_H_INCLUDED 37 38