PipeWire  0.3.29
pw_memblock Struct Reference

Memory block structure. 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

Memory block structure.

Member Function Documentation

◆ pw_memblock_free()

SPA_EXPORT void pw_memblock_free ( struct pw_memblock block)

Free a memblock.

Parameters
blocka memblock

References mapping::block, NAME, pool, pw_log_debug, SPA_CONTAINER_OF, SPA_ID_INVALID, and spa_return_if_fail.

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
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 fd, flags, memblock::mappings, memblock::memmaps, pool, ref, res, size, SPA_CONTAINER_OF, spa_list_init(), memblock::this, and type.

Referenced by pw_control_add_link().

Field Documentation

◆ fd

int pw_memblock::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().

◆ map

struct pw_memmap* pw_memblock::map

optional map when PW_MEMBLOCK_FLAG_MAP was given

Referenced by pw_mempool_import_map().

◆ pool

◆ ref

int pw_memblock::ref

refcount

Referenced by pw_mempool_alloc(), and pw_mempool_import_map().

◆ 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 struct was generated from the following files: