当前位置: 首页 > news >正文

衡水网站建设哪家专业常用的网站开发工具

衡水网站建设哪家专业,常用的网站开发工具,巢湖网站建设电话,状态管理名词解释网站开发非托管C C 有垃圾收集#xff0c;采用Hans-Boehm Garbage Collector的形式。也可能有其他垃圾收集库。 您可以使用使用RAII的智能指针#xff08;如果指针允许共享访问#xff0c;则使用引用计数#xff09;来确定何时删除对象。一个好的智能指针库是Boost的智能指针。绝大… 非托管C C 有垃圾收集采用Hans-Boehm Garbage Collector的形式。也可能有其他垃圾收集库。 您可以使用使用RAII的智能指针如果指针允许共享访问则使用引用计数来确定何时删除对象。一个好的智能指针库是Boost的智能指针。绝大多数情况下的智能指针可以取代原始指针。 一些应用程序框架如Qt构建对象树以便框架的堆分配对象具有父子关系。因此所有需要的是delete在一个对象上调用一个对象并且它的所有子对象也将自动成为deleted。 托管c 您可以通过两种方式使用.NET中的C 托管或非托管。在托管模式下.NET的垃圾回收将代表您释放内存; 在非托管模式下您接近C 的正常/标准行为因此您必须自己负责记忆。 使用公共语言运行时有许多优点部分优点如下   1它使程序的性能得到了改进 2能够轻松的使用其他语言开发的组件 3支持语言功能例如面向对象编程的继承、接口和重载 4允许创建多线程的可放缩应用程序的显示自由线程处理支持 5结构化异常处理支持 6自定义特性支持 7垃圾回收机制 8使用委托取代函数指针从而增强了类型安全和安全性。 总结 语言趋于同质化语言趋于插件化。 摘抄 真正的答案是制作安全高效的垃圾收集机制的唯一方法是对不透明引用进行语言级别的支持。或者相反缺乏对直接内存操作的语言级支持。 Java和C可以做到这一点因为它们有特殊的参考类型不能被操纵。这使运行时可以自由地执行诸如在内存中移动分配的对象这对于高性能的GC实现至关重要。 为了记录没有现代的GC实现使用引用计数所以这完全是一个红鲱鱼。现代GC使用世代收集其中新分配的处理方式基本上与堆栈分配采用C 语言相同然后定期将任何新分配的仍处于活动状态的对象移动到单独的“幸存者”空间并且整个一代的对象被立即释放。 这种方法有优点和缺点好处在于支持GC的语言的堆分配与不支持GC的语言的堆栈分配一样快缺点是在销毁之前需要执行清理的对象需要一个单独的机制例如C的using关键字否则他们的清理代码将不确定地运行。 请注意高性能GC的一个关键是必须为特定类别的参考提供语言支持。C没有这种语言支持永远不会; 因为C 有运算符重载它可以模拟一个GCd指针类型尽管它必须小心翼翼地完成。事实上当微软发明了可以在CLR.NET运行时下运行的C 方言时他们必须为“C风格的引用”例如Foo^发明新的语法以将它们与“C 风格的引用” 例如Foo。 C 的确有什么而C 程序员经常使用的是智能指针它实际上只是一个引用计数机制。我不认为引用计数是“真正的”GC但它确实提供了许多相同的好处代价是比手动内存管理或真正的GC更慢的性能但具有确定性破坏的优势。 在一天结束时答案真的归结为语言设计功能。C做出了一个选择C 做出了一个选择使其能够与C向后兼容同时仍然提供足够适用于大多数目的的替代方案并且Java和C做出了与C不兼容的另一种选择但也足够用于大多数目的。不幸的是没有银弹但熟悉不同的选择将有助于你选择正确的那个你正在试图建立的任何程序。 The real answer is that the only way to make a safe, efficient garbage collection mechanism is to have language-level support for opaque references. (Or, conversely, a lack of language-level support for direct memory manipulation.) Java and C# can do it because they have special reference types that cannot be manipulated. This gives the runtime the freedom to do things like move allocated objects in memory, which is crucial to a high-performance GC implementation. For the record, no modern GC implementation uses reference counting, so that is completely a red herring. Modern GCs use generational collection, where new allocations are treated essentially the same way that stack allocations are in a language like C, and then periodically any newly allocated objects that are still alive are moved to a separate survivor space, and an entire generation of objects is deallocated at once. This approach has pros and cons: the upside is that heap allocations in a language that supports GC are as fast as stack allocations in a language that doesnt support GC, and the downside is that objects that need to perform cleanup before being destroyed either require a separate mechanism (e.g. C#s using keyword) or else their cleanup code runs non-deterministically. Note that one key to a high-performance GC is that there must be language support for a special class of references. C doesnt have this language support and never will; because C has operator overloading, it could emulate a GCd pointer type, although it would have to be done carefully. In fact, when Microsoft invented their dialect of C that would run under the CLR (the .NET runtime), they had to invent a new syntax for C#-style references (e.g. Foo^) to distinguish them from C-style references (e.g. Foo). What C does have, and what is regularly used by C programmers, is smart pointers, which are really just a reference-counting mechanism. I wouldnt consider reference counting to be true GC, but it does provide many of the same benefits, at the cost of slower performance than either manual memory management or true GC, but with the advantage of deterministic destruction. At the end of the day, the answer really boils down to a language design feature. C made one choice, C made a choice that enabled it to be backward-compatible with C while still providing alternatives that are good enough for most purposes, and Java and C# made a different choice that is incompatible with C but is also good enough for most purposes. Unfortunately, there is no silver bullet, but being familiar with the different choices out there will help you to pick the correct one for whatever program youre currently trying to build. https://softwareengineering.stackexchange.com/questions/113177/why-do-languages-such-as-c-and-c-not-have-garbage-collection-while-java-does 参考: https://stackoverflow.com/questions/1695042/is-garbage-collection-automatic-in-standard-c https://msdn.microsoft.com/en-us/library/yk97tc08.aspx?f255MSPPError-2147217396 https://baike.baidu.com/item/%E5%85%AC%E5%85%B1%E8%AF%AD%E8%A8%80%E8%BF%90%E8%A1%8C%E6%97%B6/4361434?fraladdin 31 down vote The real answer is that the only way to make a safe, efficient garbage collection mechanism is to have language-level support for opaque references. (Or, conversely, a lack of language-level support for direct memory manipulation.) Java and C# can do it because they have special reference types that cannot be manipulated. This gives the runtime the freedom to do things like move allocated objects in memory, which is crucial to a high-performance GC implementation. For the record, no modern GC implementation uses reference counting, so that is completely a red herring. Modern GCs use generational collection, where new allocations are treated essentially the same way that stack allocations are in a language like C, and then periodically any newly allocated objects that are still alive are moved to a separate survivor space, and an entire generation of objects is deallocated at once. This approach has pros and cons: the upside is that heap allocations in a language that supports GC are as fast as stack allocations in a language that doesnt support GC, and the downside is that objects that need to perform cleanup before being destroyed either require a separate mechanism (e.g. C#s using keyword) or else their cleanup code runs non-deterministically. Note that one key to a high-performance GC is that there must be language support for a special class of references. C doesnt have this language support and never will; because C has operator overloading, it could emulate a GCd pointer type, although it would have to be done carefully. In fact, when Microsoft invented their dialect of C that would run under the CLR (the .NET runtime), they had to invent a new syntax for C#-style references (e.g. Foo^) to distinguish them from C-style references (e.g. Foo). What C does have, and what is regularly used by C programmers, is smart pointers, which are really just a reference-counting mechanism. I wouldnt consider reference counting to be true GC, but it does provide many of the same benefits, at the cost of slower performance than either manual memory management or true GC, but with the advantage of deterministic destruction. At the end of the day, the answer really boils down to a language design feature. C made one choice, C made a choice that enabled it to be backward-compatible with C while still providing alternatives that are good enough for most purposes, and Java and C# made a different choice that is incompatible with C but is also good enough for most purposes. Unfortunately, there is no silver bullet, but being familiar with the different choices out there will help you to pick the correct one for whatever program youre currently trying to build. ———————————————— 版权声明本文为CSDN博主「fengmao31」的原创文章遵循CC 4.0 BY-SA版权协议转载请附上原文出处链接及本声明。 原文链接https://blog.csdn.net/fengmao31/article/details/80170982
http://www.zqtcl.cn/news/411771/

相关文章:

  • 如何查询网站的域名注册邹城建设银行网站
  • 招生门户网站建设方案国家企业信用信息公示信息查询网
  • 用dw做淘客网站的步骤移动互联网应用技术
  • 企业合作的响应式网站石家庄网站建设推广
  • 成都网站排名优化开发广告传媒公司简介模板
  • 中山网站建设企业网站内容建设
  • 免费网站建站页面wordpress的主题在哪个文件夹
  • 国企网站建设要求站长之家排行榜
  • 做视频网站利润如何处理旅游电子商务网站建设技术规范
  • 做网站架构网页浏览器怎么卸载
  • 做甜品的网站网页传奇游戏排行榜比亚迪
  • 广州网站建设菲利宾百度关键词优化排名
  • 南昌网站建设业务wordpress添加购买按钮
  • 个人现在可以做哪些网站企业所得税是多少
  • 网站建设招标信息科技企业网站建设
  • 怎样弄网站站长工具综合查询
  • 表白网站在线制作软件合肥seo按天收费
  • 襄阳企业网站建设免费行情的软件入口下载
  • 对百度网站进行分析中国机械加工网18易0下6拉en
  • 一般做网站都在什么网做wordpress轮播图设置
  • 深圳装饰公司网站thinkphp 网站根目录地址
  • 购物网站建设资讯原创文章代写
  • 门票预订网站建设wordpress siren主题
  • 单位建设网站装修公司需要什么资质
  • 做做做网站做网站赚外快
  • 网站备案后应该做什么网站流量监测
  • 开发网站用什么语言做名片的网站叫什么来着
  • 织梦做网站好不好iis中的网站启动不了
  • 临汾住房与城乡建设厅网站迎访问中国建设银行网站_
  • 织梦做的网站首页幻灯片怎么不能显示北大青鸟网站建设课程