From 7eb0b004f35cee37219845ae50fb8eb712c23899 Mon Sep 17 00:00:00 2001 From: KUDr Date: Wed, 27 Jun 2007 22:29:57 +0000 Subject: (svn r10366) -Codechange [YAPF]: added DEBUG_YAPF_CACHE macro that (when set to 1) allows to track YAPF "cache errors". They are probably responsible for current MP desyncs. (thanks Rubidium for this great idea!). I will deal with those errors/desyncs tomorrow. --- src/yapf/yapf_costrail.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/yapf/yapf_costrail.hpp') diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp index c27a28167..4fd541ce6 100644 --- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -55,6 +55,7 @@ protected: protected: int m_max_cost; CBlobT m_sig_look_ahead_costs; + bool m_disable_cache; public: bool m_stopped_on_first_two_way_signal; @@ -64,6 +65,7 @@ protected: CYapfCostRailT() : m_max_cost(0) + , m_disable_cache(false) , m_stopped_on_first_two_way_signal(false) { // pre-compute look-ahead penalties into array @@ -468,7 +470,8 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th FORCEINLINE bool CanUseGlobalCache(Node& n) const { - return (n.m_parent != NULL) + return !m_disable_cache + && (n.m_parent != NULL) && (n.m_parent->m_num_signals_passed >= m_sig_look_ahead_costs.Size()); } @@ -481,6 +484,10 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th } } + void DisableCache(bool disable) + { + m_disable_cache = disable; + } }; -- cgit v1.2.3-70-g09d2