1. A method for providing software transactional protection of managed pointers comprising the steps of: at compile time, determining that there are one or more variables being passed by reference to separately compiled code segments in at least one code segment being compiled; selecting at least one technique for communicating the sources of the variables being passed by reference; modifying the at least one code segment to implement the selected technique; and creating an executable using the modified code segment.