]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcfs.c
Add *NeededBytesAlign(), which overestimates the padding which is later
[fontconfig.git] / src / fcfs.c
index 3ba567479d1c225291f041670c14e7ae0d5269e3..0788a6f628769e7eea06aaf5e6a577457b2b929e 100644 (file)
@@ -108,9 +108,19 @@ FcFontSetNeededBytes (FcFontSet *s)
        return 0;
 }
 
+/* Returns an overestimate of the number of bytes that
+ * might later get eaten up by padding in the ALIGN macro. */
+int
+FcFontSetNeededBytesAlign (void)
+{
+    return __alignof__(int) + 
+       FcPatternNeededBytesAlign () + FcObjectNeededBytesAlign ();
+}
+
 void *
 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr)
 {
+    block_ptr = ALIGN (block_ptr, int);
     fcfs_pat_count = (int *)block_ptr;
     block_ptr = (int *)block_ptr + 1;
     // we don't consume any bytes for the fontset itself,