Re: glib outstanding stuff
- From: Havoc Pennington <hp redhat com>
- To: Joel Becker <jlbec evilplan org>
- Cc: gtk-devel-list gnome org
- Subject: Re: glib outstanding stuff
- Date: 04 Oct 2000 21:33:04 -0400
Joel Becker <jlbec evilplan org> writes:
> If the file is too big, the initial g_new() will fail, so there
> is no crash. In addition, this saves all the resizings of the g_string.
> As we are willing to read as large a chunk as the kernel will give us,
> we don't need buffering ala stdio.
> This is what I have in my personal convenience libs (modulo
> error checking, of course). If there's a good reason for your version,
> I'd like to know so I can change. :-)
Yes, your version looks better to me (modulo the fact that g_new()
does indeed crash if it fails - but we can just replace it with
g_try_malloc() and it will be fine).
] [Thread Prev