Right. Note that on Arm, gcc aligns even byte-structs to 4 bytes.  That's
why we have -mstructure-size-boundary=8 in configure.ac on arm.

On Sun, Nov 27, 2016 at 1:22 PM, Ebrahim Byagowi <ebrami...@gmail.com>
wrote:

> didn't know about byte array alignment trick, thanks :)
>
> On Sun, Nov 27, 2016 at 6:16 PM, Richard Wordingham <
> richard.wording...@ntlworld.com> wrote:
>
>> On Sat, 26 Nov 2016 23:52:40 +0330
>> Ebrahim Byagowi <ebrami...@gmail.com> wrote:
>>
>> > Hey guys, just like to know how harfbuzz handles memory alignment
>> > without having even one #pragma pack around? Does `IntType`
>> > <https://github.com/behdad/harfbuzz/blob/02bfd965af588640250
>> c47f344ad3096c8a373e0/src/hb-open-type-private.hh#L626>
>> > handles padding somehow or harfbuzz copies its own structs? Thanks.
>>
>> If you look at the specialisations of struct BEInt immediately above
>> in the same file, you'll see that the values are handled as arrays of
>> unsigned bytes (type uint8_t).  Endianity and misalignment are handled
>> together.
>>
>> One OpenType table that may contain misaligned data is the name table
>> - nothing forces UTF-16 characters to be aligned on 2-byte boundaries,
>> and I've seen fonts where it isn't so aligned.
>>
>> Richard.
>> _______________________________________________
>> HarfBuzz mailing list
>> HarfBuzz@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>
>
>
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
>


-- 
behdad
http://behdad.org/
_______________________________________________
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to