projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix enum dump; fix float formats; fix dumps
[m6w6/ext-psi]
/
src
/
types
/
impl_type.c
diff --git
a/src/types/impl_type.c
b/src/types/impl_type.c
index f865bd899dac3129cff4f50a847c9d39bab29e27..41baf1c5af87cc1bd2122b4a7cb5f462349f81fc 100644
(file)
--- a/
src/types/impl_type.c
+++ b/
src/types/impl_type.c
@@
-26,26
+26,29
@@
#include "php_psi_stdinc.h"
#include "data.h"
#include "php_psi_stdinc.h"
#include "data.h"
-struct psi_impl_type *psi_impl_type_init(token_t type,
const char
*name)
+struct psi_impl_type *psi_impl_type_init(token_t type,
zend_string
*name)
{
{
- struct psi_impl_type *t =
calloc(1, sizeof(*t)
);
+ struct psi_impl_type *t =
pecalloc(1, sizeof(*t), 1
);
t->type = type;
t->type = type;
- t->name =
strdup
(name);
+ t->name =
zend_string_copy
(name);
return t;
}
return t;
}
+void psi_impl_type_dump(struct psi_dump *dump, struct psi_impl_type *type)
+{
+ PSI_DUMP(dump, "%s", type->name->val);
+}
+
void psi_impl_type_free(struct psi_impl_type **type_ptr)
{
if (*type_ptr) {
struct psi_impl_type *type = *type_ptr;
*type_ptr = NULL;
void psi_impl_type_free(struct psi_impl_type **type_ptr)
{
if (*type_ptr) {
struct psi_impl_type *type = *type_ptr;
*type_ptr = NULL;
- if (type->token) {
- free(type->token);
- }
- free(type->name);
+ psi_token_free(&type->token);
+ zend_string_release(type->name);
free(type);
}
}
free(type);
}
}