我的理解是,一個類的基本數據類型(UINT,字符串,數字等)不需要被設置爲null垃圾收集。ActionScript - 內存管理的基元/非基元對象之間的區別?
例如,我不要求寫在下面的類此dispose()
方法:
package
{
//Imports
import flash.display.Shape;
//Class
public class DrawSquare extends Shape
{
//Properties
private var squareColorProperty:uint;
//Constructor
public function DrawSquare(squareColor:uint)
{
squareColorProperty = squareColor;
init();
}
//Initialize
private function init():void
{
graphics.beginFill(shapeColorProperty);
graphics.drawRect(0, 0, 200, 200);
graphics.endFill();
}
//Dispose
public function dispose():void
{
squareColorProperty = null;
}
//Get Shape Color
public function get squareColor():uint;
{
return squareColorProperty;
}
}
}
如果這是真的,我相信這是,什麼是原始類型和對象的對象之間的差異關於內存分配的非原始類型?
GCAtomic.ppt的鏈接已被打破,但它看起來像有人通過Slideshare提供:http://www.slideshare.net/bufanliu/gc-atomic –