PipeWire  0.3.15
pw_memblock Class Reference
Collaboration diagram for pw_memblock:

Public Types

enum  pw_memblock_flags
 Flags passed to pw_mempool_alloc() More...
 

Public Member Functions

SPA_EXPORT struct pw_memblockpw_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_mempoolpool
 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_memmapmap
 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

Flags passed to pw_mempool_alloc()

Member Function Documentation

◆ pw_memblock_free()

◆ 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
poolthe pool to use
flagsmemblock flags
typethe requested memory type one of enum spa_data_type
sizesize 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

◆ 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

◆ ref

int pw_memblock::ref

◆ 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: