Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide inline free(3) wrapper, so it's easier to plug the code into out memory usage tracking framework. #188

Merged
merged 1 commit into from
Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/ucl_emitter_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ static const struct ucl_emitter_context ucl_standard_emitters[] = {
}
};

static inline void
_ucl_emitter_free(void *p)
{

free(p);
}

/**
* Get standard emitter context for a specified emit_type
* @param emit_type type of emitter
Expand Down Expand Up @@ -405,7 +412,7 @@ ucl_object_emit_memory_funcs (void **pmem)
f->ucl_emitter_append_double = ucl_utstring_append_double;
f->ucl_emitter_append_int = ucl_utstring_append_int;
f->ucl_emitter_append_len = ucl_utstring_append_len;
f->ucl_emitter_free_func = free;
f->ucl_emitter_free_func = _ucl_emitter_free;
utstring_new (s);
f->ud = s;
*pmem = s->d;
Expand Down Expand Up @@ -454,7 +461,7 @@ ucl_object_emit_fd_funcs (int fd)
f->ucl_emitter_append_double = ucl_fd_append_double;
f->ucl_emitter_append_int = ucl_fd_append_int;
f->ucl_emitter_append_len = ucl_fd_append_len;
f->ucl_emitter_free_func = free;
f->ucl_emitter_free_func = _ucl_emitter_free;
f->ud = ip;
}

Expand Down