PipeWire: pw_memblock Class Reference

PipeWire 0.3.20

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

A memory pool is a collection of pw_memblocks. More...

Collaboration diagram for pw_memblock:
[legend]

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

## Public Member Functions
SPA_EXPORT struct pw_memblock * | pw_mempool_alloc (struct pw_mempool *pool, enum pw_memblock_flags flags, uint32_t type, size_t size)
| Create a new memblock. More...
SPA_EXPORT void | pw_memblock_free (struct pw_memblock *block)
| Free a memblock. More...

## Data Fields
struct pw_mempool * | pool
| owner pool More...
uint32_t | id
| unique id More...
int | ref
| refcount More...
uint32_t | flags
| flags for the memory block on of enum pw_memblock_flags More...
uint32_t | type
| type of the fd, one of enum spa_data_type More...
int | fd
| fd More...
uint32_t | size
| size of memory More...
struct pw_memmap * | map
| optional map when PW_MEMBLOCK_FLAG_MAP was given More...

## Detailed Description

A memory pool is a collection of pw_memblocks.

Memory block structure.

## Member Enumeration Documentation

## ◆ pw_memblock_flags

enum pw_memblock_flags

Flags passed to pw_mempool_alloc()

## Member Function Documentation

## ◆ pw_memblock_free()

SPA_EXPORT void pw_memblock_free | ( | struct pw_memblock * | block | ) |

Free a memblock.

Parameters

  mem | a memblock

References mapping::block, memblock::link, mapping::link, memblock::mappings, memblock::memmaps, NAME, pool, pw_log::pw_log_debug, pw_log::pw_log_warn, pw_map::pw_map_remove(), PW_MEMBLOCK_FLAG_DONT_NOTIFY, pw_memmap_free(), pw_mempool_emit_removed, and memmap::this.

Referenced by pw_mempool_clear().

## ◆ pw_mempool_alloc()

SPA_EXPORT struct pw_memblock * pw_mempool_alloc | ( | struct pw_mempool * | pool,
|  | enum pw_memblock_flags | flags,
|  | uint32_t | type,
|  | size_t | size
| ) |  |

Create a new memblock.

Parameters

  pool | the pool to use
  flags | memblock flags
  type | the requested memory type one of enum spa_data_type
  size | size to allocate

Returns
  a memblock structure or NULL with errno on error

References F_ADD_SEALS, F_SEAL_GROW, F_SEAL_SEAL, F_SEAL_SHRINK, fd, flags, map, memblock::mappings, memblock::memmaps, MFD_ALLOW_SEALING, MFD_CLOEXEC, NAME, pool, pw_log::pw_log_error, pw_log::pw_log_warn, PW_MEMBLOCK_FLAG_MAP, PW_MEMBLOCK_FLAG_SEAL, pw_memblock_map(), ref, res, size, memblock::this, and type.

Referenced by pw_control_add_link().

## Field Documentation

## ◆ fd

int pw_memblock::fd

fd

Referenced by pw_memmap_free(), pw_mempool_alloc(), pw_mempool_import_block(), and pw_mempool_remove_id().

## ◆ flags

uint32_t pw_memblock::flags

flags for the memory block on of enum pw_memblock_flags

Referenced by pw_mempool_alloc(), and pw_mempool_import_block().

## ◆ id

uint32_t pw_memblock::id

unique id

Referenced by pw_mempool_find_ptr(), and pw_mempool_remove_id().

## ◆ map

struct pw_memmap* pw_memblock::map

optional map when PW_MEMBLOCK_FLAG_MAP was given

Referenced by pw_mempool_alloc(), and pw_mempool_import_map().

## ◆ pool

struct pw_mempool* pw_memblock::pool

owner pool

Referenced by pw_memblock_free(), pw_memblock_map(), pw_memmap_free(), pw_mempool_alloc(), and pw_mempool_import_block().

## ◆ ref

int pw_memblock::ref

refcount

Referenced by pw_mempool_alloc(), pw_mempool_import_map(), and pw_mempool_remove_id().

## ◆ size

uint32_t pw_memblock::size

size of memory

Referenced by pw_mempool_alloc().

## ◆ type

uint32_t pw_memblock::type

type of the fd, one of enum spa_data_type

Referenced by pw_mempool_alloc(), and pw_mempool_import_block().

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

- mem.h
- mem.c