I have taken a look at the different ways I could handle the extensions and it is a complete mess. :)
Currently the search is doing an inCheck at the beginning of each node to determine if we should extend for check. That inCheck is then used by null-moves and futility pruning for the current position.
After that futility pruning does another inCheck to determine if the next position will be in check, this is also done by the late move reduction.
So the worst case scenario does three inCheck lookups for one node. Which is just bad.
I have had a 'history'-array for quite some time that keeps track of passed castling rights, en passant squares and the fifty moves rule. Recently I extended that idea by adding another array that kept track of passed zobrist keys and captures to make the unmakeMove faster.
So basically there already is a stack keeping track of passed positions, only that it lacks information about inCheck and it does not remember what moves was made (only if they were a capture or not).
I am going to complete the stack with the needed information and make the inCheck while making each move so we always have that information.
I do not expect this to speed up the search that much, however the code will be much easier to modify which in turn will help make everything faster.