Join Kit Eason for an in-depth discussion in this video The "fixed" keyword, part of What's New in Visual Studio 2017 for F# For Developers.
- [Instructor] We're finished with struct values now.…We're going to look at another memory-related topic,…and that is the fixed keyword.…The fixed keyword lets you do two things.…It lets you know where in memory something's been allocated,…and it also lets you guarantee…that while that thing remains in scope,…it doesn't get moved in memory.…Because basically, remember that the garbage collector…can do two things to you.…One is it might free up stuff…that you're no longer referring to,…and obviously that reference…is only kind of within the scope…of the language you're working.…
So it's got no knowledge of what other processes…might be looking at that memory.…But also it may choose to move things around in memory.…Invisibly to you as an F# or C# developer,…but obviously very visible to, again, some other process…that might be looking at that piece of memory.…And this is important in interoperation scenarios…where you might be providing a pointer…to some piece of memory for another process to examine…or, I suppose, even to update.…
Kit Eason discusses the new value types that provide an opportunity for performance gains, the new result type which gives you access to the railway oriented programming style of error handling, and program organization and readability changes. Plus, he explores the evolution of tooling for F#, and explains how F# tooling has changed in Visual Studio 2017. To wrap up the course, he shares how you can contribute to the F# language and tooling by getting involved in the open-source community.
- Working with struct tuples
- Marking a record type as a struct value
- Marking a discriminated union as a struct type
- Using the fixed keyword to mark a value
- F# result type and associated functions
- Resolving potential naming clashes between modules and types
- Error message improvements
- The past and future of visual F# tooling in Visual Studio
- Reviewing F# tooling changes