1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 #include "oic_malloc.h"
27 // Enable extra debug logging for malloc. Comment out to disable
28 //#define ENABLE_MALLOC_DEBUG (1)
30 #ifdef ENABLE_MALLOC_DEBUG
32 #define TAG PCF("OICMalloc")
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 // Internal API function
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 // Private internal function prototypes
53 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
59 void *OICMalloc(size_t size)
61 #ifdef ENABLE_MALLOC_DEBUG
70 OIC_LOG_V(INFO, TAG, "malloc: ptr=%p, size=%u", ptr, size);
81 void OICFree(void *ptr)
83 #ifdef ENABLE_MALLOC_DEBUG
84 OIC_LOG_V(INFO, TAG, "free: ptr=%p", ptr);