• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: 系统适配层内存接口(此文件为DEMO,需集成方适配修改)
15  */
16 #ifndef HILINK_MEM_ADAPTER_H
17 #define HILINK_MEM_ADAPTER_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*
24  * 描述: 申请内存空间
25  * 参数: size,表示申请内存空间大小
26  * 返回: 申请内存空间指针
27  */
28 void *HILINK_Malloc(unsigned int size);
29 
30 /*
31  * 描述: 释放内存空间
32  * 参数: pt,表示释放内存空间指针
33  */
34 void HILINK_Free(void *pt);
35 
36 /*
37  * 描述: 内存比较
38  * 参数: buf1,指向内存块的指针
39  *       buf2,指向内存块的指针
40  *       len,要比较的字节数
41  * 返回: 0表示buf1和buf2指向的内存中内容相同, 大于0表示buf1大于buf2,小于0表示buf1小于buf2
42  */
43 int HILINK_Memcmp(const void *buf1, const void *buf2, unsigned int len);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* HILINK_MEM_ADAPTER_H */
50