gwion-util
utilities for the Gwion project
Loading...
Searching...
No Matches
mp_string.h
Go to the documentation of this file.
1
4#ifndef __MP_STRING
5#define __MP_STRING
6
8ANN static inline void free_mstr(MemPool mp, char *const str) {
9 _mp_free(mp, strlen(str) + 1, str);
10}
11
13ANN static inline m_str mstrdup(MemPool mp, const char *name) {
14 const m_str dup = (m_str)_mp_malloc(mp, strlen(name) + 1);
15 strcpy(dup, name);
16 return dup;
17}
18#endif
#define ANN
Definition defs.h:19
char * m_str
Definition gwcommon.h:14
char ** str
Definition gwion_print.h:2
static ANN m_str mstrdup(MemPool mp, const char *name)
mp_alloc version of strdup
Definition mp_string.h:13
static ANN void free_mstr(MemPool mp, char *const str)
free mp_allocated string
Definition mp_string.h:8
void _mp_free(MemPool mp, const m_uint size, void *ptr)
Definition mpool.c:124
ANEW ANN void * _mp_malloc(MemPool, const m_uint) __attribute__((hot))