PipeWire: mem.c File Reference

PipeWire 0.3.34

Data Structures | Macros | Functions
mem.c File Reference

## Data Structures
struct | mempool
struct | memblock
struct | mapping
struct | memmap

## Macros
#define | NAME "mempool"
#define | HAVE_MEMFD_CREATE 1
#define | MFD_CLOEXEC 0x0001U
#define | MFD_ALLOW_SEALING 0x0002U
#define | F_LINUX_SPECIFIC_BASE 1024
#define | F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
#define | F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
#define | F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
#define | F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
#define | F_SEAL_GROW 0x0004 /* prevent file from growing */
#define | F_SEAL_WRITE 0x0008 /* prevent writes */
#define | pw_mempool_emit(p, m, v, ...) spa_hook_list_call(&p->listener_list, struct pw_mempool_events, m, v, ##__VA_ARGS__)
#define | pw_mempool_emit_destroy(p) pw_mempool_emit(p, destroy, 0)
#define | pw_mempool_emit_added(p, b) pw_mempool_emit(p, added, 0, b)
#define | pw_mempool_emit_removed(p, b) pw_mempool_emit(p, removed, 0, b)

## Functions
struct pw_mempool * | pw_mempool_new (struct pw_properties *props)
| Create a new memory pool. More...
void | pw_mempool_clear (struct pw_mempool *pool)
| Clear a pool. More...
void | pw_mempool_destroy (struct pw_mempool *pool)
| Clear and destroy a pool. More...
void | pw_mempool_add_listener (struct pw_mempool *pool, struct spa_hook *listener, const struct pw_mempool_events *events, void *data)
| Listen for events. More...
struct pw_memmap * | pw_memblock_map (struct pw_memblock *block, enum pw_memmap_flags flags, uint32_t offset, uint32_t size, uint32_t tag[5])
| Map a region of a memory block. More...
struct pw_memmap * | pw_mempool_map_id (struct pw_mempool *pool, uint32_t id, enum pw_memmap_flags flags, uint32_t offset, uint32_t size, uint32_t tag[5])
| Map a region of a memory block with id. More...
int | pw_memmap_free (struct pw_memmap *map)
| Unmap a region. More...
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...
struct pw_memblock * | pw_mempool_import (struct pw_mempool *pool, enum pw_memblock_flags flags, uint32_t type, int fd)
| Import an fd into the pool. More...
struct pw_memblock * | pw_mempool_import_block (struct pw_mempool *pool, struct pw_memblock *mem)
| Import a block from another pool. More...
struct pw_memmap * | pw_mempool_import_map (struct pw_mempool *pool, struct pw_mempool *other, void *data, uint32_t size, uint32_t tag[5])
int | pw_mempool_remove_id (struct pw_mempool *pool, uint32_t id)
| Remove a memblock for given id. More...
void | pw_memblock_free (struct pw_memblock *block)
| Free a memblock. More...
struct pw_memblock * | pw_mempool_find_ptr (struct pw_mempool *pool, const void *ptr)
| Find memblock for given ptr. More...
struct pw_memblock * | pw_mempool_find_id (struct pw_mempool *pool, uint32_t id)
| Find memblock for given id. More...
struct pw_memblock * | pw_mempool_find_fd (struct pw_mempool *pool, int fd)
| Find memblock for given fd. More...
struct pw_memmap * | pw_mempool_find_tag (struct pw_mempool *pool, uint32_t tag[5], size_t size)
| find a map with the given tag More...

## Macro Definition Documentation

## ◆ F_ADD_SEALS

#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)

## ◆ F_GET_SEALS

#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)

## ◆ F_LINUX_SPECIFIC_BASE

#define F_LINUX_SPECIFIC_BASE 1024

## ◆ F_SEAL_GROW

#define F_SEAL_GROW 0x0004 /* prevent file from growing */

## ◆ F_SEAL_SEAL

#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */

## ◆ F_SEAL_SHRINK

#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */

## ◆ F_SEAL_WRITE

#define F_SEAL_WRITE 0x0008 /* prevent writes */

## ◆ HAVE_MEMFD_CREATE

#define HAVE_MEMFD_CREATE 1

## ◆ MFD_ALLOW_SEALING

#define MFD_ALLOW_SEALING 0x0002U

## ◆ MFD_CLOEXEC

#define MFD_CLOEXEC 0x0001U

## ◆ NAME

#define NAME "mempool"

## ◆ pw_mempool_emit

#define pw_mempool_emit | ( |  | p,
|  |  | m,
|  |  | v,
|  |  | ...
| ) |  | spa_hook_list_call(&p->listener_list, struct pw_mempool_events, m, v, ##__VA_ARGS__)

## ◆ pw_mempool_emit_added

#define pw_mempool_emit_added | ( |  | p,
|  |  | b
| ) |  | pw_mempool_emit(p, added, 0, b)

## ◆ pw_mempool_emit_destroy

#define pw_mempool_emit_destroy | ( |  | p | ) | pw_mempool_emit(p, destroy, 0)

## ◆ pw_mempool_emit_removed

#define pw_mempool_emit_removed | ( |  | p,
|  |  | b
| ) |  | pw_mempool_emit(p, removed, 0, b)