added ifdef END_SHEAP_ROUTINES_WITH_BARRIER