gtk.cfg: Add support for g_alloca() and g_newa().
References: https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-alloca https://github.com/GNOME/glib/blob/master/glib/galloca.h
This commit is contained in:
parent
e64fc279f0
commit
f6c3749015
|
@ -40,6 +40,9 @@
|
|||
<define name="g_signal_connect(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)"/>
|
||||
<define name="g_signal_connect_after(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)"/>
|
||||
<define name="g_signal_connect_swapped(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)"/>
|
||||
<!-- https://github.com/GNOME/glib/blob/master/glib/galloca.h -->
|
||||
<define name="g_alloca(size)" value="alloca (size)"/>
|
||||
<define name="g_newa(struct_type, n_structs)" value="((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs)))"/>
|
||||
<memory>
|
||||
<alloc init="true">g_thread_new</alloc>
|
||||
<alloc init="true">g_thread_try_new</alloc>
|
||||
|
|
|
@ -70,3 +70,10 @@ void g_print_test()
|
|||
// cppcheck-suppress invalidPrintfArgType_uint
|
||||
g_printerr("%x", "a");
|
||||
}
|
||||
|
||||
void g_alloca_test()
|
||||
{
|
||||
// cppcheck-suppress allocaCalled
|
||||
char * pBuf1 = g_alloca(5);
|
||||
pBuf1[0] = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue