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. We should have a linearlize_chunks variant that always copies and use that. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Alexander Larsson Red Hat, Inc al...@redhat.com alexander.lars...@gmail.com He's a time-tossed flyboy boxer with a winning smile and a way with the ladies. She's a wealthy junkie advertising executive from aristocratic European stock. They fight crime! _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel