/* We assume that arrays of graphene_point_t are aligned on an 8-byte *boundary,whichmeanswecanusethelowest3bitstorepresentup
* to 8 distinct path operations. */ #define GSK_PATHOP_OPERATION_MASK (0x7)
/* graphene_point_t is a struct containing two floats, so an array of *graphene_point_tonthestackisnotnecessarily8-bytealigned *unlessweforceittobe. * *Usingaunionforthismeansthecompilerwillwarnorerrorifwe *havenothandledthesecorrectly:forexamplewecangofroma *GskAlignedPoint*toagraphene_point_t*(whichisalwaysOK)with: * *GskAlignedPoint*gap=...; *graphene_point_t*gpt; *gpt=&gap[0].pt; * *butgoingbacktheotherwayisnotpossiblewithoutacastora
* compiler warning. */ typedefunion
{
graphene_point_t pt;
/* On many platforms this will be enough to force the correct alignment. */
guint64 alignment;
/* Unfortunately not all platforms require guint64 to be naturally-aligned *(forexampleoni386,only4-bytealignmentisrequired)sowehaveto
* try harder. */ #ifdef __GNUC__
__attribute__((aligned(8))) guint64 really_aligned; #elifdefined(_MSC_VER)
__declspec(align(8)) guint64 really_aligned; #endif
} GskAlignedPoint;
/* included inline so tests can use them */ staticinline void gsk_path_builder_pathop_to (GskPathBuilder *builder,
gskpathop op); staticinline void gsk_path_builder_pathop_reverse_to (GskPathBuilder *builder,
gskpathop op);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.