From 44804a9579e0e817127f3d070c3d050bedaa73e9 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 10 Feb 2017 11:58:24 -0600 Subject: [PATCH] ecore: Don't call _ecore_fd_valid() in release builds Not sure _ecore_fd_valid() is all that useful anymore, as the commit that introduced it said it would be removed "before release" a long time ago - it's a debug assist that probably doesn't need to be in release builds. (I'm counting syscalls on rpi3 - still, calling this an optimization seems like a bit of a stretch.) --- configure.ac | 5 +++++ src/lib/ecore/ecore_main.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 89a0fe3b2e..2ccedf16a4 100644 --- a/configure.ac +++ b/configure.ac @@ -86,16 +86,21 @@ esac prefer_assert="no" eina_log_backtrace="yes" +efl_less_insane="no" case "${build_profile}" in dev|debug) prefer_assert="yes" eina_log_backtrace="no" + efl_less_insane="yes" ;; esac # Enable CRI & ERR backtrace by default for release but not for dev/debug AC_DEFINE_IF([EINA_LOG_BACKTRACE_ENABLE], [test "x${eina_log_backtrace}" = "xyes"], [1], [Default log level triggering backtraces]) +# Additional sanity checks only performed in debug builds +AC_DEFINE_IF([EFL_EXTRA_SANITY_CHECKS], [test "x${efl_less_insane}" = "xyes"], [1], [Extra run time sanity checks]) + # TODO: add some build "profile" (server, full, etc...) AC_ARG_WITH([crypto], diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index ebd272d669..125c886e65 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -344,6 +344,7 @@ _ecore_fd_close_on_exec(int fd) #endif } +#ifdef EFL_EXTRA_SANITY_CHECKS static inline void _ecore_fd_valid(void) { @@ -360,6 +361,7 @@ _ecore_fd_valid(void) } } } +#endif static inline void _ecore_try_add_to_call_list(Ecore_Fd_Handler *fdh) @@ -1997,7 +1999,9 @@ _ecore_main_fd_handlers_call(void) } } fdh->references--; +#ifdef EFL_EXTRA_SANITY_CHECKS _ecore_fd_valid(); +#endif fdh->read_active = EINA_FALSE; fdh->write_active = EINA_FALSE;