more verbose context ops
[m6w6/ext-psi] / src / types / decl_struct.c
index c2b8cc1779806b8582d150dcc30e87d11a2cf1a7..d2a211d5c467596e4c079a96903b5401d6f4b354 100644 (file)
@@ -31,7 +31,7 @@
 struct psi_decl_struct* psi_decl_struct_init(zend_string *name,
                struct psi_plist *args)
 {
-       struct psi_decl_struct *s = calloc(1, sizeof(*s));
+       struct psi_decl_struct *s = pecalloc(1, sizeof(*s), 1);
        s->name = zend_string_copy(name);
        s->args = args;
        return s;
@@ -47,22 +47,19 @@ void psi_decl_struct_free(struct psi_decl_struct **s_ptr)
                if (s->args) {
                        psi_plist_free(s->args);
                }
-               if (s->engine.type && s->engine.dtor) {
-                       s->engine.dtor(s->engine.type);
-               }
                zend_string_release(s->name);
                free(s);
        }
 }
 
-void psi_decl_struct_dump(int fd, struct psi_decl_struct *strct)
+void psi_decl_struct_dump(struct psi_dump *dump, struct psi_decl_struct *strct)
 {
-       dprintf(fd, "struct %s::(%zu, %zu)", strct->name->val, strct->align,
+       PSI_DUMP(dump, "struct %s::(%zu, %zu)", strct->name->val, strct->align,
                        strct->size);
        if (psi_plist_count(strct->args)) {
-               psi_decl_type_dump_args_with_layout(fd, strct->args, 0);
+               psi_decl_type_dump_args_with_layout(dump, strct->args, 0);
        } else {
-               dprintf(fd, ";");
+               PSI_DUMP(dump, ";");
        }
 }