PipeWire: pw_memblock Class Reference

PipeWire 0.1.8

Public Types | Public Member Functions | Data Fields
pw_memblock Class Reference

Memory block structure. More...

## Public Types
enum | pw_memblock_flags
| Flags passed to pw_memblock_alloc() More...

## Public Member Functions
int | pw_memblock_map (struct pw_memblock *mem)
| Map a memblock. More...
int | pw_memblock_alloc (enum pw_memblock_flags flags, size_t size, struct pw_memblock **mem)
| Create a new memblock. More...
void | pw_memblock_free (struct pw_memblock *mem)
| Free a memblock. More...

## Data Fields
enum pw_memblock_flags | flags
| flags used when allocating More...
int | fd
| memfd if any More...
off_t | offset
| offset of mappable memory More...
void * | ptr
| ptr to mapped memory More...
size_t | size
| size of mapped memory More...

## Detailed Description

Memory block structure.

## Member Enumeration Documentation

## ◆ pw_memblock_flags

enum pw_memblock_flags

Flags passed to pw_memblock_alloc()

## Member Function Documentation

## ◆ pw_memblock_alloc()

int pw_memblock_alloc | ( | enum pw_memblock_flags | flags,
|  | size_t | size,
|  | struct pw_memblock ** | mem
| ) |  |

Create a new memblock.

Parameters

  | flags | memblock flags
  | size | size to allocate
  [out] | mem | memblock structure to fill

Returns
  0 on success, < 0 on error

References fd, flags, memblock::mem, offset, ptr, PW_MEMBLOCK_FLAG_MAP_TWICE, PW_MEMBLOCK_FLAG_WITH_FD, and size.

Referenced by pw_control_link(), and pw_memblock_import().

## ◆ pw_memblock_free()

void pw_memblock_free | ( | struct pw_memblock * | mem | ) |

Free a memblock.

Parameters

  mem | a memblock

References fd, flags, memblock::link, memblock::mem, ptr, PW_MEMBLOCK_FLAG_WITH_FD, and size.

Referenced by pw_control_destroy(), pw_port_alloc_buffers(), pw_port_set_param(), and pw_port_use_buffers().

## ◆ pw_memblock_map()

int pw_memblock_map | ( | struct pw_memblock * | mem | ) |

Map a memblock.

Parameters

  mem | a memblock

Returns
  0 on success, < 0 on error

References fd, flags, offset, ptr, PW_MEMBLOCK_FLAG_MAP_READ, PW_MEMBLOCK_FLAG_MAP_READWRITE, PW_MEMBLOCK_FLAG_MAP_TWICE, PW_MEMBLOCK_FLAG_MAP_WRITE, and size.

Referenced by pw_memblock_import().

## Field Documentation

## ◆ fd

int pw_memblock::fd

memfd if any

Referenced by pw_memblock_alloc(), pw_memblock_free(), pw_memblock_import(), and pw_memblock_map().

## ◆ flags

enum pw_memblock_flags pw_memblock::flags

flags used when allocating

Referenced by pw_memblock_alloc(), pw_memblock_free(), pw_memblock_import(), and pw_memblock_map().

## ◆ offset

off_t pw_memblock::offset

offset of mappable memory

Referenced by pw_memblock_alloc(), pw_memblock_import(), and pw_memblock_map().

## ◆ ptr

void* pw_memblock::ptr

ptr to mapped memory

Referenced by pw_control_link(), pw_memblock_alloc(), pw_memblock_free(), and pw_memblock_map().

## ◆ size

size_t pw_memblock::size

size of mapped memory

Referenced by pw_memblock_alloc(), pw_memblock_free(), pw_memblock_import(), and pw_memblock_map().

The documentation for this class was generated from the following files:

- mem.h
- mem.c