GArray is defined as following:
struct GArray {
gchar *data;
guint len;
};
So it can contain as many data as memory can hold. And, guint is unsigned int, which can be up to 4Gb, not 65536.
Digging deeper to GLib source, you can see, that g_array_append_val will call g_array_expand, which will later rely on g_realloc to reallocate memory. And in g_realloc sources you can see:
newmem = glib_mem_vtable.realloc (mem, n_bytes);
TRACE (GLIB_MEM_REALLOC((void*) newmem, (void*)mem, (unsigned int) n_bytes, 0));
if (newmem)
return newmem;
g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes", G_STRLOC, n_bytes);
So it will fail with message 'failed to allocate %d bytes'.