5 #ifndef _MONO_MEMPOOL_INTERNALS_H_
6 #define _MONO_MEMPOOL_INTERNALS_H_
10 #include "mono/utils/mono-compiler.h"
11 #include "mono/metadata/mempool.h"
14 g_list_prepend_mempool (MonoMemPool
*mp
, GList
*list
, gpointer data
)
18 new_list
= (GList
*) mono_mempool_alloc (mp
, sizeof (GList
));
19 new_list
->data
= data
;
20 new_list
->prev
= list
? list
->prev
: NULL
;
21 new_list
->next
= list
;
24 new_list
->prev
->next
= new_list
;
26 list
->prev
= new_list
;
32 g_slist_prepend_mempool (MonoMemPool
*mp
, GSList
*list
, gpointer data
)
36 new_list
= (GSList
*) mono_mempool_alloc (mp
, sizeof (GSList
));
37 new_list
->data
= data
;
38 new_list
->next
= list
;
44 g_slist_append_mempool (MonoMemPool
*mp
, GSList
*list
, gpointer data
)
49 new_list
= (GSList
*) mono_mempool_alloc (mp
, sizeof (GSList
));
50 new_list
->data
= data
;
51 new_list
->next
= NULL
;
57 last
->next
= new_list
;
65 g_list_append_mempool (MonoMemPool
*mp
, GList
*list
, gpointer data
)
69 new_list
= (GList
*) mono_mempool_alloc0 (mp
, sizeof (GList
));
70 new_list
->data
= data
;
71 new_list
->prev
= g_list_last (list
);
73 new_list
->prev
->next
= new_list
;
75 return list
? list
: new_list
;
79 mono_mempool_strdup_vprintf (MonoMemPool
*pool
, const char *format
, va_list args
);
82 mono_mempool_strdup_printf (MonoMemPool
*pool
, const char *format
, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
85 mono_mempool_get_bytes_allocated (void);