1 /******************************************************************************
4 Lantiq Deutschland GmbH
6 For licensing information, see the file 'LICENSE' in the root folder of
9 ******************************************************************************/
10 #ifndef __MEM_DEFS_H__
11 #define __MEM_DEFS_H__
15 #ifdef MTCFG_ENABLE_OBJPOOL
19 /* Special versions for objpool */
20 static __INLINE
void *
21 malloc_objpool (size_t size
, unsigned int tag
)
27 free_objpool (void *buffer
)
32 /* Normal allocator that must be monitored by objpool */
33 static __INLINE
void *
34 _malloc_tag (size_t size
, unsigned int tag
, mtlk_slid_t caller_slid
)
36 void *buf
= malloc(mem_leak_get_full_allocation_size(size
));
37 return mem_leak_handle_allocated_buffer(buf
, size
, caller_slid
);
41 _free_tag (void *buffer
)
43 void *buf
= mem_leak_handle_buffer_to_free(buffer
);
47 #define malloc_tag(size, tag) _malloc_tag((size), (tag), MTLK_SLID)
48 #define free_tag(buffer) _free_tag(buffer)
50 #else /* MTCFG_ENABLE_OBJPOOL */
52 #define malloc_tag(a, b) malloc((a))
55 #endif /* MTCFG_ENABLE_OBJPOOL */
57 #endif /* __MEM_DEFS_H__ */