upipe/umem.h header reference
Upipe generic memory allocators More
Header inclusion
Members
Types
Functions
- bool umem_alloc(struct umem_mgr *mgr, struct umem *umem, size_t size)
- uint8_t * umem_buffer(struct umem *umem)
- void umem_free(struct umem *umem)
- void umem_mgr_release(struct umem_mgr *mgr)
- struct umem_mgr * umem_mgr_use(struct umem_mgr *mgr)
- void umem_mgr_vacuum(struct umem_mgr *mgr)
- bool umem_realloc(struct umem *umem, size_t new_size)
- size_t umem_size(struct umem *umem)
Description
Upipe generic memory allocators
Members detail
This macro is declared in upipe/umem.h source file, line 31.
This struct is declared in upipe/umem.h source file, line 50.
This struct is not treated the same way as other structures in Upipe: it is not allocated by the manager, but by the caller. The manager only "inits" it.
This function is declared in upipe/umem.h source file, line 110.
This function allocates a new umem buffer space.
Parameter list:
- mgr: management structure
- umem: caller-allocated structure, filled in with the required pointer and size (previous content is discarded)
- size: requested size of the umem
The return value is false if the memory couldn't be allocated (umem left untouched)
uint8_t * umem_buffer(struct umem *umem)
This function is declared in upipe/umem.h source file, line 67.
This function returns a pointer to the buffer space pointed to by a umem.
Parameter list:
- umem: pointer to umem
The return value is pointer to the buffer space
void umem_free(struct umem *umem)
This function is declared in upipe/umem.h source file, line 137.
This function frees a umem.
Parameter list:
- mgr: management structure
- umem: caller-allocated structure, previously successfully passed to umem_alloc
- umem: pointer to umem
This struct is declared in upipe/umem.h source file, line 85.
This struct defines a memory allocator management structure.
Field | Description |
---|---|
struct urefcount * refcount; | pointer to refcount management structure |
bool (*umem_alloc)(struct umem_mgr *, struct umem *, size_t ) ; | function to allocate a new memory block |
bool (*umem_realloc)(struct umem *, size_t ) ; | function to resize umem |
void (*umem_free)(struct umem *) ; | function to free a umem |
void (*umem_mgr_vacuum)(struct umem_mgr *) ; | function to release all buffers kept in pools |
void umem_mgr_release(struct umem_mgr *mgr)
This function is declared in upipe/umem.h source file, line 172.
This function decrements the reference count of a umem manager or frees it.
Parameter list:
- mgr: pointer to umem manager
This function is declared in upipe/umem.h source file, line 160.
This function increments the reference count of a umem manager.
Parameter list:
- mgr: pointer to umem manager
The return value is same pointer to umem manager
void umem_mgr_vacuum(struct umem_mgr *mgr)
This function is declared in upipe/umem.h source file, line 148.
This function instructs an existing umem manager to release all structures currently kept in pools. It is intended as a debug tool only.
Parameter list:
- mgr: pointer to umem manager
bool umem_realloc(struct umem *umem, size_t new_size)
This function is declared in upipe/umem.h source file, line 124.
This function resizes a umem.
Parameter list:
- mgr: management structure
- umem: caller-allocated structure, previously successfully passed to umem_alloc, and filled in with the new pointer and size
- new_size: new requested size of the umem
The return value is false if the memory couldn't be allocated (umem left untouched)
size_t umem_size(struct umem *umem)
This function is declared in upipe/umem.h source file, line 78.
This function returns the size of the buffer space pointed to by a umem.
Parameter list:
- umem: pointer to umem
The return value is size of the buffer space