• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include "osal_message.h"
10 #include "osal_mem.h"
11 
HdfMessageObtain(size_t extendSize)12 struct HdfMessage *HdfMessageObtain(size_t extendSize)
13 {
14     size_t newSize = sizeof(struct HdfMessage) + extendSize;
15     return (struct HdfMessage *)OsalMemCalloc(newSize);
16 }
17 
HdfMessageRecycle(struct HdfMessage * message)18 void HdfMessageRecycle(struct HdfMessage *message)
19 {
20     OsalMemFree(message);
21 }
22 
HdfMessageDelete(struct HdfSListNode * listEntry)23 void HdfMessageDelete(struct HdfSListNode *listEntry)
24 {
25     struct HdfMessage *message = (struct HdfMessage *)listEntry;
26     if (message != NULL) {
27         HdfMessageRecycle(message);
28     }
29 }
30 
31