GNOME Bugzilla – Bug 647618
sizeof(G) broken for G = int
Last modified: 2016-11-30 14:29:37 UTC
void print_size<G> () { print ("the answer is %lu\n", sizeof (G)); } void main () { print_size<int>(); } "the answer is 8"
Of course, this is because Vala uses 'sizeof (gpointer)' here. Worse: glib doesn't have a facility for answering this question correctly. My particular use case is that I'm trying to write a function to resize arrays and I want to use it with an array of ints.
GType provides no size information for fundamental types like int through g_type_query?
*** This bug has been marked as a duplicate of bug 774713 ***