gwion-util
utilities for the Gwion project
Loading...
Searching...
No Matches
mp_string.h
Go to the documentation of this file.
1
4#pragma once
5
7ANN static inline void free_mstr(MemPool mp, char *const str) {
8 _mp_free(mp, strlen(str) + 1, str);
9}
10
12ANN static inline m_str mstrdup(MemPool mp, const char *name) {
13 const m_str dup = (m_str)_mp_malloc(mp, strlen(name) + 1);
14 strcpy(dup, name);
15 return dup;
16}
#define ANN
Definition defs.h:18
char * m_str
Definition gwcommon.h:15
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:12
static ANN void free_mstr(MemPool mp, char *const str)
free mp_allocated string
Definition mp_string.h:7
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))
struct MemPool_ * MemPool