1// Use g_new() & friends where that makes obvious sense
2@@
3type T;
4@@
5-g_malloc(sizeof(T))
6+g_new(T, 1)
7@@
8type T;
9@@
10-g_try_malloc(sizeof(T))
11+g_try_new(T, 1)
12@@
13type T;
14@@
15-g_malloc0(sizeof(T))
16+g_new0(T, 1)
17@@
18type T;
19@@
20-g_try_malloc0(sizeof(T))
21+g_try_new0(T, 1)
22@@
23type T;
24expression n;
25@@
26-g_malloc(sizeof(T) * (n))
27+g_new(T, n)
28@@
29type T;
30expression n;
31@@
32-g_try_malloc(sizeof(T) * (n))
33+g_try_new(T, n)
34@@
35type T;
36expression n;
37@@
38-g_malloc0(sizeof(T) * (n))
39+g_new0(T, n)
40@@
41type T;
42expression n;
43@@
44-g_try_malloc0(sizeof(T) * (n))
45+g_try_new0(T, n)
46@@
47type T;
48expression p, n;
49@@
50-g_realloc(p, sizeof(T) * (n))
51+g_renew(T, p, n)
52@@
53type T;
54expression p, n;
55@@
56-g_try_realloc(p, sizeof(T) * (n))
57+g_try_renew(T, p, n)
58@@
59type T;
60expression n;
61@@
62-(T *)g_new(T, n)
63+g_new(T, n)
64@@
65type T;
66expression n;
67@@
68-(T *)g_new0(T, n)
69+g_new0(T, n)
70@@
71type T;
72expression p, n;
73@@
74-(T *)g_renew(T, p, n)
75+g_renew(T, p, n)
76