[Spice-devel] [PATCH 2/5] qxl parser: add cursor parsing

Alexander Larsson alexl at redhat.com
Thu Aug 26 23:56:01 PDT 2010


On Fri, 2010-08-27 at 08:51 +0200, Gerd Hoffmann wrote:
> On 08/27/10 08:38, Alexander Larsson wrote:
> > On Fri, 2010-08-27 at 00:09 +0200, Gerd Hoffmann wrote:
> >>
> >> +    red->data_size = qxl->data_size;
> >> +    size = red_get_data_chunks_ptr(slots, group_id,
> >> +                                   get_memslot_id(slots, addr),
> >> +&chunks,&qxl->chunk);
> >> +    data = red_linearize_chunk(&chunks, size,&free_data);
> >> +    red_put_data_chunks(&chunks);
> >> +    red->data = spice_malloc(size);
> >> +    memcpy(red->data, data, size);
> >> +
> >> +    if (free_data) {
> >> +        free(data);
> >> +    }
> >
> > Ack, but this part could be more efficient. In the n_chunks>  1 case the
> > red_linearize_chunk part will already malloc and copy the data so we
> > don't need to do it then.
> 
> Right.  Incremental patch attached.

Ack

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a hate-fuelled zombie barbarian looking for a cure to the poison coursing 
through his veins. She's a scantily clad cat-loving politician who hides her 
beauty behind a pair of thick-framed spectacles. They fight crime! 



More information about the Spice-devel mailing list