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