X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftoken.c;h=7b303e712fa0c44ebdea49cc1d3227b8b064bc3f;hb=35060621f2fd5079502543d17942127c1a602f72;hp=316c734384843e16e275face12f3c9c81cf382ad;hpb=2559f07a178b681dc240e20153ff5abdff54cb34;p=m6w6%2Fext-psi diff --git a/src/token.c b/src/token.c index 316c734..7b303e7 100644 --- a/src/token.c +++ b/src/token.c @@ -41,7 +41,7 @@ struct psi_token *psi_token_init(token_t token_typ, const char *token_txt, { struct psi_token *T; - T = calloc(1, sizeof(*T)); + T = pecalloc(1, sizeof(*T), 1); T->type = token_typ; T->col = col; T->line = line; @@ -67,7 +67,7 @@ void psi_token_free(struct psi_token **token_ptr) { } struct psi_token *psi_token_copy(struct psi_token *src) { - struct psi_token *ptr = malloc(sizeof(*ptr)); + struct psi_token *ptr = pemalloc(sizeof(*ptr), 1); *ptr = *src; #if PSI_DEBUG_TOKEN_ALLOC @@ -88,7 +88,7 @@ struct psi_token *psi_token_cat(const char *sep, unsigned argc, ...) { va_list argv; unsigned i; size_t sep_len = sep ? strlen(sep) : 0; - struct psi_token *T = malloc(sizeof(*T)); + struct psi_token *T = pemalloc(sizeof(*T), 1); smart_str text = {0}; va_start(argv, argc);