[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Alignment in AMF data

From: Rob Savoye
Subject: Re: [Gnash-dev] Alignment in AMF data
Date: Fri, 24 Oct 2008 13:10:37 -0600
User-agent: Thunderbird (X11/20080723)

Bastiaan Jacques wrote:
> So is this also an issue for differently sized integers? If so, we might
> just change swapBytes to make a copy of the data and returning that
> (after swapping the bytes).

  There are two schools of though on byte swapping. One thread is that
when swapping bytes, you should never modify the raw data as read, and
always make a copy of it. Most of the gnash code that uses swapBytes()
defines a local variable, usually set by type casting from the raw data
as read in network order. This is then passed to swapBytes(), so in a
sense, we're already making a copy. This is the way I've been handling
byte swapping so far.

  The other thread is that one always should just swap the raw data in
place to avoid a copy, as you'd most likely always use the data in the
host byte order anyway. This is better performance, but not what we're
doing now.

        - rob -

reply via email to

[Prev in Thread] Current Thread [Next in Thread]