首页 \ 问答 \ ValueType包装器的垃圾回收(Garbage collection for ValueType wrappers)

ValueType包装器的垃圾回收(Garbage collection for ValueType wrappers)

ValueType类MSDN链接引用

在需要值类型像对象一样行为的情况下,使值类型看起来像引用对象的包装器将分配到堆上,并将值类型的值复制到其中。 包装器被标记,所以系统知道它包含一个值类型。

这意味着我的代码就像“integerVariable.ToString();” 创建的包装对象允许使用此方法以及类似System.Object的所有其他方法。

这种理解是否正确?

这些对象与“常规”对象有何不同?

这个对象的垃圾收集是不同的? 如果是,如何?

提前致谢。


Quoting from the MSDN Link for ValueType Class

In cases where it is necessary for a value type to behave like an object, a wrapper that makes the value type look like a reference object is allocated on the heap, and the value type's value is copied into it. The wrapper is marked so the system knows that it contains a value type.

This means when I code like "integerVariable.ToString();" a wrapper-object created allows using this method and similarly all the other methods of System.Object.

Is this understanding correct?

How are these objects different from the 'regular' objects?

Is the Garbage Collection different for such object? If yes, how?

Thanks in advance.


原文:https://stackoverflow.com/questions/415995
更新时间:2023-05-19 18:05

最满意答案

这并不完美,但效果很好(在iPad 2上试过)。 如果有人想改善动态,请成为我的客人。 我很糟糕。

工作实例

希望它适合您的需求


This is not perfect, but it works great (tried on iPad 2). If anybody wants to improve the dynamic though, be my guest. I suck at it.

Projet

Working Example

Hope it suits your needs

相关问答

更多
  • 看这里: http://www.sencha.com/forum/showthread.php?142107-image-upload 或者在这里: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/ http://zacvineyard.com/blog/2011/03/25/upload-a-file-to-a-remote-server-with-phonegap/ Look here: http://ww ...
  • 我们通过在项目中包含iScroll.js解决了这个问题。 有关其文档,请参见http://iscrolljs.com/#zoom 。 它对我们很有效,但它需要一些时间来正确设置。 We have solved this by including iScroll.js in the project. See http://iscrolljs.com/#zoom for its documentation. It's working nicely for us however it required some ...
  • 我解决了! 我查看了Sencha-2.2源代码,发现selectfield从textfield selectfield扩展而来。 我在我自己的类areaselectfield复制了selectfield源,并且只更改了两行: extend: 'Ext.field.TextArea', xtype: 'areaselectfield' 也许有更简单的方法,但它的工作原理 I solved it! I looked through Sencha-2.2 sources and found that selec ...
  • 以下是您如何使用Sencha Touch实现该布局: 不幸的是,这很难解释,但希望它是有道理的。 我还创建了这个布局的一个非常简单的例子,可以在这里看到: http : //www.senchafiddle.com/#jxiA8 (确保你按下Run )。 至于哪些对象/组件; 他们都将是Ext.Containers 。 理想情况下,您将使用MVC结构为每个这些项目创建自定义类(这将扩展Ext.Container)。 这对于Sencha Touch来说绝对是一个很好的用例。 创建这样的丰富应用程序非常棒。 H ...
  • 为了实现这一点,您可以使用Ext.Menu并将其安装在左侧或右侧。 对于此功能,您不需要第三方库,它已包含在Sencha Touch中。 http://docs.sencha.com/touch/2.3.0/#!/api/Ext.Menu In order to achieve this you can use Ext.Menu and mount it on the left or right side. You don't need third party library for this featur ...
  • 最适合您的选择是TouchTreeGrid: https : //github.com/swluken/TouchTreeGrid The best option for you will be TouchTreeGrid: https://github.com/swluken/TouchTreeGrid
  • Sencha Touch是Javascript。 它是用JS编写的,图书馆里没有什么魔力。 如果你了解JS,你应该能够理解Sencha Touch。 Sencha Touch和JQuery是解决相同问题的非常不同的方法。 Sencha Touch使用面向对象的编程概念远远超过jQuery。 同样,有些东西非常相似。 在jQuery中工作了很长时间后,在接近其他Javascript库时需要有一个开放的头脑,因为jQuery没有遵循不同的概念。 图书馆也针对不同的“利基”。 我会说Sencha Touch更像是 ...
  • 这并不完美,但效果很好(在iPad 2上试过)。 如果有人想改善动态,请成为我的客人。 我很糟糕。 谟 工作实例 希望它适合您的需求 This is not perfect, but it works great (tried on iPad 2). If anybody wants to improve the dynamic though, be my guest. I suck at it. Projet Working Example Hope it suits your needs
  • 看看https://github.com/mitchellsimoens/Ext.ux.touch.grid这是Sencha Touch的网格实现。 have a look at https://github.com/mitchellsimoens/Ext.ux.touch.grid This is a grid implementation for Sencha Touch.
  • 1)为简单起见,我个人认为每个整体平台(Android,iPhone,Blackberry)使用最高分辨率/大小。 手机将相应地缩放图像。 它只是让事情更简单; 我不介意的唯一原因是,如果你有一个真正庞大的总图像大小,优化是> 10mb之间的差异。 每当手机必须缩放任何图像时,显然会有轻微的性能损失,但最终对我来说并不明显。 2)Sencha支持视网膜显示。 只要您使用足够高分辨率的图像,它就会被正确缩放。 当然,请确保包含视网膜显示闪屏和应用程序图标 。 1) For simplicity's sake, ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。