PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/flash-src/third-party/com/hurlant/util/Memory.as

http://github.com/gimite/web-socket-js
ActionScript | 28 lines | 17 code | 1 blank | 10 comment | 0 complexity | b1585d2de7202af0af367bb9cabd80b6 MD5 | raw file
 1/**
 2 * Memory
 3 * 
 4 * A class with a few memory-management methods, as much as 
 5 * such a thing exists in a Flash player.
 6 * Copyright (c) 2007 Henri Torgemane
 7 * 
 8 * See LICENSE.txt for full license information.
 9 */
10package com.hurlant.util
11{
12	import flash.net.LocalConnection;
13	import flash.system.System;
14	
15	public class Memory
16	{
17		public static function gc():void {
18			// force a GC
19			try {
20			   new LocalConnection().connect('foo');
21			   new LocalConnection().connect('foo');
22			} catch (e:*) {}
23		}
24		public static function get used():uint {
25			return System.totalMemory;
26		}
27	}
28}