什么是管理类型?他们是否具体到德尔福?它们是否适用于Windows? [英] What are managed types? Are they specific to Delphi? Are they specific to Windows?

查看:219
本文介绍了什么是管理类型?他们是否具体到德尔福?它们是否适用于Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

总结

请检查以下知识点。

= ================================================ ===========

==============================================================

我已经看到相当于提到的管理类型几个stackoverflow Delphi主题。例如,在正确初始化/完成的主题中提到。但是,当我的谷歌托管类型,似乎大多数链接与C ++或.NET有关。例如,请参阅 MSDN页面 。有人可以帮助评论Delphi中定义的托管类型?鉴于Delphi for POSIX / MacOS正在诞生,是特定于Windows的托管类型?感谢您的努力和时间提前!

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:主题正确初始化/完成

在Delphi中初始化哪些变量?

<一个href =http://stackoverflow.com/questions/132725/are-delphi-variables-initialized-with-a-value-by-default> delphi变量是否默认初始值?值
br>
我应该如何在Delphi 7析构函数中释放一组对象?

在Delphi 2009中,我需要释放变量数组吗?

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?

推荐答案

Delphi 的上下文中,托管类型是Delphi Compiler自动生成生命周期管理代码的类型。这包括:

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

由于 Delphi 上下文是根据Delphi编译器生成的内容定义的,它们是特定于delphi的。

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

在.NET世界中开发人员不需要管理分配的内存的生命周期,因为.NET提供了一个自动执行此操作的机制:垃圾收集器。但是,.NET包括处理CLR之外的东西的能力(例如:使用不针对CLR的本机DLL)。该代码通常被称为不带电和不安全的。

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.

在.NET管理的上下文中与CLR自动管理有关,所以这是.NET特定术语!

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

这篇关于什么是管理类型?他们是否具体到德尔福?它们是否适用于Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆