+ decl_arg *darg = strct->args->args[i];
+ ffi_type *type = malloc(sizeof(*type));
+ size_t padding;
+
+ memcpy(type, psi_ffi_decl_arg_type(darg), sizeof(*type));
+
+ ZEND_ASSERT(type->size == darg->layout->len);
+
+ if (type->alignment > maxalign) {
+ maxalign = type->alignment;
+ }
+
+ if ((padding = psi_offset_padding(darg->layout->pos - offset, type->alignment))) {
+ if (nels + padding + 1 > argc) {
+ argc += padding;
+ els = realloc(els, (argc + 1) * sizeof(*els));
+ els[argc] = NULL;
+ }
+ psi_ffi_struct_type_pad(&els[nels], padding);
+ nels += padding;
+ offset += padding;
+ }
+ ZEND_ASSERT(offset == darg->layout->pos);
+
+ offset = (offset + darg->layout->len + type->alignment - 1) & ~(type->alignment - 1);
+ els[nels++] = type;
+ }
+
+ /* apply struct alignment padding */
+ offset = (offset + maxalign - 1) & ~(maxalign - 1);
+
+ ZEND_ASSERT(offset <= strct->size);
+ if (offset < strct->size) {
+ psi_ffi_struct_type_pad(&els[nels], strct->size - offset);