upipe/umem.h header reference

Upipe generic memory allocators More

Header inclusion  

Members  

Types  

Functions  

Description  

Upipe generic memory allocators

Members detail  

#define _UPIPE_UMEM_H_  

This macro is declared in upipe/umem.h source file, line 31.

struct umem  

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.

FieldDescription
struct umem_mgr * mgr;pointer to the entity responsible for the management
uint8_t * buffer;pointer to actual buffer space
size_t size;requested size of the buffer space
size_t real_size;real size of the buffer space

bool umem_alloc(struct umem_mgr *mgr, struct umem *umem, size_t size)  

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

struct umem_mgr  

This struct is declared in upipe/umem.h source file, line 85.

This struct defines a memory allocator management structure.

FieldDescription
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

struct umem_mgr * umem_mgr_use(struct umem_mgr *mgr)  

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

Valid XHTML 1.0 StrictGenerated by cmassiot on Fri Feb 2 23:57:19 2018 using MkDoc