少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
 * \file
 */
 
#ifndef _MONO_MEMPOOL_INTERNALS_H_
#define _MONO_MEMPOOL_INTERNALS_H_
 
#include <glib.h>
 
#include "mono/utils/mono-compiler.h"
#include "mono/metadata/mempool.h"
 
static inline GList*
g_list_prepend_mempool (MonoMemPool *mp, GList *list, gpointer data)
{
    GList *new_list;
    
    new_list = (GList *) mono_mempool_alloc (mp, sizeof (GList));
    new_list->data = data;
    new_list->prev = list ? list->prev : NULL;
    new_list->next = list;
 
    if (new_list->prev)
            new_list->prev->next = new_list;
    if (list)
            list->prev = new_list;
 
    return new_list;
}
 
static inline GSList*
g_slist_prepend_mempool (MonoMemPool *mp, GSList *list, gpointer  data)
{
    GSList *new_list;
    
    new_list = (GSList *) mono_mempool_alloc (mp, sizeof (GSList));
    new_list->data = data;
    new_list->next = list;
 
    return new_list;
}
 
static inline GSList*
g_slist_append_mempool (MonoMemPool *mp, GSList *list, gpointer data)
{
    GSList *new_list;
    GSList *last;
 
    new_list = (GSList *) mono_mempool_alloc (mp, sizeof (GSList));
    new_list->data = data;
    new_list->next = NULL;
 
    if (list) {
        last = list;
        while (last->next)
            last = last->next;
        last->next = new_list;
 
        return list;
    } else
        return new_list;
}
 
static inline GList*
g_list_append_mempool (MonoMemPool *mp, GList *list, gpointer data)
{
    GList *new_list;
 
    new_list = (GList *) mono_mempool_alloc0 (mp, sizeof (GList));
    new_list->data = data;
    new_list->prev = g_list_last (list);
    if (new_list->prev)
        new_list->prev->next = new_list;
 
    return list ? list : new_list;
}
 
char*
mono_mempool_strdup_vprintf (MonoMemPool *pool, const char *format, va_list args);
 
char*
mono_mempool_strdup_printf (MonoMemPool *pool, const char *format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);;
 
long
mono_mempool_get_bytes_allocated (void);
 
#endif