[Spice-devel] [PATCH spice-gtk] coroutine: abort on OOM or impossible conditions

Marc-André Lureau mlureau at redhat.com
Tue Nov 19 09:00:31 PST 2013


ok

----- Original Message -----
> On Tue, Nov 19, 2013 at 05:30:55PM +0100, Marc-André Lureau wrote:
> > @@ -75,21 +73,13 @@ int coroutine_init(struct coroutine *co)
> >  			    PROT_READ | PROT_WRITE,
> >  			    MAP_PRIVATE | MAP_ANONYMOUS,
> >  			    -1, 0);
> > -	if (co->cc.stack == MAP_FAILED)
> > -		g_error("Failed to allocate %u bytes for coroutine stack: %s",
> > -			(unsigned)co->stack_size, strerror(errno));
> > +	g_assert(co->cc.stack != MAP_FAILED);
> > +
> 
> The g_error() here is much better imo. Actually I'd favour more use of
> g_error() and less use of g_assert throughout this patch.
> 
> Christophe
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list