Chapter 2, Implementing C# Interoperability
- Platform invocation.
- Explain what
P/Invoke
is. - It reminds the programmer that they are responsible for the safety of their code, since it is not managed by the .NET Framework.
- There are three generations of objects: zero, one, and two. Normally, objects are added to generation zero and garbage is collected. But if they survive generation zero, they are promoted to generation one. Objects that survive generation one are promoted to generation two. If generations zero, one, and two are completely full and new objects are added, then you end up with
OutOfMemoryException
, and your application will crash. - The
fixed
keyword is used to ensure that objects referenced by pointers are not promoted by the garbage collector. Otherwise, the pointers would point to the wrong thing, causing bugs in the software. - BSTR.
- IronPython, although other packages also exist.
- Implement the disposable design pattern.
- Set large fields...