]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcname.c
Add *NeededBytesAlign(), which overestimates the padding which is later
[fontconfig.git] / src / fcname.c
index 0767e114d2fe14b1d3440bb4a9131dda7559fc6a..6ca4f1ad30b3e497ba188189043cf2ad9d2145ac 100644 (file)
@@ -332,12 +332,20 @@ FcObjectNeededBytes ()
     return num + sizeof(int);
 }
 
+int
+FcObjectNeededBytesAlign (void)
+{
+    return __alignof__ (int) + __alignof__ (char);
+}
+
 void *
 FcObjectDistributeBytes (FcCache * metadata, void * block_ptr)
 {
     *(int *)block_ptr = biggest_known_ntypes;
+    block_ptr = ALIGN (block_ptr, int);
     block_ptr = (int *) block_ptr + 1;
     biggest_ptr = block_ptr;
+    block_ptr = ALIGN (block_ptr, char);
     block_ptr = (char *) block_ptr + biggest_known_count;
     return block_ptr;
 }