r6.1.1:lfds611_abstraction_malloc

From liblfds.org
Jump to navigation Jump to search

Source Files

/liblfds611/src/lfds611_abstraction/lfds611_abstraction_malloc.c
/liblfds611/inc/liblfds611.h

Prototype

void *lfds611_abstraction_malloc( size_t size );

Parameters

size_t size

Number of bytes to allocate.

Return Value

Pointer to the allocated memory, NULL if allocation fails.

Notes

The liblfds internally wraps this function in an aligned allocator to provide aligned allocation, which is required for atomic operations. Zero length allocations are never requested, so the question in that case of returning NULL or not is irrelevant.

Examples

The implementation of lfds611_abstraction_malloc on every platform except Windows kernel looks like this;

 #if (!defined WIN_KERNEL_BUILD)
 
   /* TRD : any OS except Windows kernel on any CPU with any compiler
 
            !WIN_KERNEL_BUILD  indicates not Windows kernel
   */
 
   void *lfds611_abstraction_malloc( size_t size )
   {
     return( malloc(size) );
   }
 
 #endif

See Also