gwion-util
utilities for the Gwion project
Loading...
Searching...
No Matches
Functions
mp_string.h File Reference

string allocated with memory pool More...

Go to the source code of this file.

Functions

static ANN void free_mstr (MemPool mp, char *const str)
 free mp_allocated string
 
static ANN m_str mstrdup (MemPool mp, const char *name)
 mp_alloc version of strdup
 

Detailed Description

string allocated with memory pool

Definition in file mp_string.h.

Function Documentation

◆ free_mstr()

static ANN void free_mstr ( MemPool mp,
char *const str )
inlinestatic

free mp_allocated string

Definition at line 8 of file mp_string.h.

8 {
9 _mp_free(mp, strlen(str) + 1, str);
10}
char ** str
Definition gwion_print.h:2
void _mp_free(MemPool mp, const m_uint size, void *ptr)
Definition mpool.c:124

◆ mstrdup()

static ANN m_str mstrdup ( MemPool mp,
const char * name )
inlinestatic

mp_alloc version of strdup

Definition at line 13 of file mp_string.h.

13 {
14 const m_str dup = (m_str)_mp_malloc(mp, strlen(name) + 1);
15 strcpy(dup, name);
16 return dup;
17}
char * m_str
Definition gwcommon.h:14
ANEW ANN void * _mp_malloc(MemPool, const m_uint) __attribute__((hot))