What are managed types? Are they specific to Delphi? Are they specific to Windows?

不问归期 提交于 2019-11-29 07:40:50

In the context of Delphi, managed types are those types for whom the Delphi Compiler automatically generates lifecycle management code. This includes:

  • Strings
  • Open Dynamic Arrays
  • Records containing other managed types
  • Interfaces
  • (later edit) Anonymous methods
  • (later edit) Variants

Because managed types in the Delphi context are defined in terms of what the Delphi compiler generates, they're delphi-specific.


In the .NET world the developer doesn't need to manage the lifecycle of allocated memory because .NET provides an automatic mechanism for doing this: The Garbage Collector. But .NET includes the ability to work with things outside the CLR (example: using native DLL's that don't target the CLR). That code is usually called unamanged and unsafe.

In the context of .NET managed relates to what the CLR automatically manages, so that's .NET specific term!

Uli Gerhardt

See Barry Kelly's answer to a releated thread. Since managed types are a language feature there shouldn't be significant changes on Mac OS et al.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!