RTEMS  5.1
Data Structures | Typedefs | Functions
rtl-bit-alloc.h File Reference

RTEMS Run-Time Linker Bit Allocator Header. More...

#include <rtems/rtl/rtl-fwd.h>
#include <rtems/rtl/rtl-obj-fwd.h>

Go to the source code of this file.

Data Structures

struct  rtems_rtl_bit_alloc
 

Typedefs

typedef struct rtems_rtl_bit_alloc rtems_rtl_bit_alloc
 

Functions

rtems_rtl_bit_allocrtems_rtl_bit_alloc_open (void *base, size_t size, size_t block_size, size_t used)
 
void rtems_rtl_bit_alloc_close (rtems_rtl_bit_alloc *balloc)
 
void * rtems_rtl_bit_alloc_balloc (rtems_rtl_bit_alloc *balloc, size_t size)
 
void rtems_rtl_bit_alloc_bfree (rtems_rtl_bit_alloc *balloc, void *addr, size_t size)
 

Detailed Description

RTEMS Run-Time Linker Bit Allocator Header.

Typedef Documentation

◆ rtems_rtl_bit_alloc

Bit Allocator data

Function Documentation

◆ rtems_rtl_bit_alloc_balloc()

void* rtems_rtl_bit_alloc_balloc ( rtems_rtl_bit_alloc balloc,
size_t  size 
)

Allocate a piece of memory being managed. The size is in bytes are is rounded up the next block size.

Parameters
ballocThe allocator.
sizeNumber of bytes to allocate.
Returns
void* The memory if the allocation is successful else NULL if there is no more memory.

◆ rtems_rtl_bit_alloc_bfree()

void rtems_rtl_bit_alloc_bfree ( rtems_rtl_bit_alloc balloc,
void *  addr,
size_t  size 
)

Free an allocated memory block. The size is required because the allocator does not contain any state information.

◆ rtems_rtl_bit_alloc_close()

void rtems_rtl_bit_alloc_close ( rtems_rtl_bit_alloc balloc)

Close the bit allocator.

Parameters
ballocThe allocator to close.

◆ rtems_rtl_bit_alloc_open()

rtems_rtl_bit_alloc* rtems_rtl_bit_alloc_open ( void *  base,
size_t  size,
size_t  block_size,
size_t  used 
)

Open a bit allocator. The allocator allocates block_size pieces of the memory being managed.

Parameters
baseThe memory to managem NULL to allocate a piece of memory.
sizeThe size of the memory being managed in bytes.
block_sizeThe minimum allocation unit in bytes.
usedThe amount of memory already in use in bytes.
Return values
rtems_rtl_bit_allocThe bit allocator structure.