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

perf: avoid gumbo_debug function calls when GUMBO_DEBUG isn't def'd #2723

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions gumbo-parser/src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,4 @@ void gumbo_debug(const char* format, ...) {
va_end(args);
fflush(stdout);
}
#else
void gumbo_debug(const char* UNUSED_ARG(format), ...) {}
#endif
4 changes: 4 additions & 0 deletions gumbo-parser/src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ void* gumbo_realloc(void* ptr, size_t size) RETURNS_NONNULL;
void gumbo_free(void* ptr);

// Debug wrapper for printf
#ifdef GUMBO_DEBUG
void gumbo_debug(const char* format, ...) PRINTF(1);
#else
static inline void PRINTF(1) gumbo_debug(const char* UNUSED_ARG(format), ...) {};
#endif

#ifdef __cplusplus
}
Expand Down