+}
+
+void CPPFile::output_marshall(CompiledBasicType &cbt, Datum *d)
+{
+ printf("marshall cbt\n");
+}
+
+void CPPFile::align_type(Symbol *sym)
+{
+ file << indent << "_ctx.buf.align_to(__alignof__(";
+ cpp_output_name(file, sym);
+ file << "));\n";
+}
+
+void CPPFile::grow_buf(Symbol *sym)
+{
+ file << indent << "_ptr = _ctx.buf.grow_by(sizeof(";
+ cpp_output_name(file, sym);
+ file << "));\n";
+}
+
+void CPPFile::output_marshall(Struct *sym, Datum *d)
+{
+ bool is_inline = !d || d->is_inline();
+
+ if (d && !d->is_inline()) {
+ extra_newline();
+ file << indent << "if (" << **d->name << ")\n"
+ << indent << '\t' << **d->name << "->_marshall(_ctx);\n";
+
+ return;
+ }
+
+ if (!d) {
+ extra_newline();
+ align_type(sym);
+ grow_buf(sym);
+
+ file << indent << "memcpy(_ptr, this, sizeof(*this));\n";
+ }
+
+ if (sym->is_plain_data()) {
+ printf("plain data\n");
+ return;
+ }