Summarization:
Please check the knowledgeable comments below.
==============================================================
I have seen the term of managed types
mentioned in quite a few stackoverflow Delphi topics. For example, it is mentioned in topics of correctly initializing/finalizing
. However, when I google managed types
, it seems most links are related to C++, or .NET. For example, see the MSDN page. Could some one help to comment what are managed types defined in Delphi? Given that Delphi for POSIX/MacOS is being born, are managed types specific to Windows? Thanks for your effort and time in advance!
PS: Topics of correctly initializing/finalizing
:
Which variables are initialized when in Delphi?
Are delphi variables initialized with a value by default?
How should I free an array of objects in a Delphi 7 destructor?
In Delphi 2009 do I need to free variant arrays?
In the context of Delphi
, managed types are those types for whom the Delphi Compiler automatically generates lifecycle management code. This includes:
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With