RTEMS: cpukit/libdl/rtl-bit-alloc.h File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
rtl-bit-alloc.h File Reference
API » RTEMS Runtime Link Editor

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_alloc * | rtems_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

typedef struct rtems_rtl_bit_alloc 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

  balloc | The allocator.
  size | Number 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

  balloc | The 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

  base | The memory to managem NULL to allocate a piece of memory.
  size | The size of the memory being managed in bytes.
  block_size | The minimum allocation unit in bytes.
  used | The amount of memory already in use in bytes.

Return values

  rtems_rtl_bit_alloc | The bit allocator structure.