Closed thisiscam closed 7 years ago
protect/unprotect is simply more versatile, as it requires less calls to protect/unprotect than to ref/deref.
Maybe over the lifetime of a variable you change its values hundreds of times. Those are hundreds of ref/deref calls you don't have to do if you use protect/unprotect.
I'm working on a C# binding of sylvan here https://github.com/thisiscam/SylvanSharp
I'm wondering why is "protect/unprotect" preferred over "ref/deref"? I don't want to make very subtle bugs(especially in a concurrent C# program) so a hint of explanation will be really helpful!