npm.io
1.0.2 • Published 8 years ago

memoryutil

Licence
ISC
Version
1.0.2
Deps
0
Size
19 kB
Vulns
0
Weekly
0

MemoryManger

#install

npm install memoryutil

#use

var MemoryManager = require('memoryutil').MemoryManger
var memeorypool = new MemoryManager()
var Point = function(x, y) {
    this.x = x
    this.y = y
}

var Line = function(point1, point2) {
    this.start = point1
    this.end = point2
}

var point1 = memeorypool.allocateObject(Point)
var point2 = memeorypool.allocateObject(Point)
var line = memeorypool.allocateObject(Line)