Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Object Pool

Language

Creational pattern for memory performance

Class Diagram

Problem

Unreasonable creation large amount of data

Solution

Storing objects in context pool for possible reusing

Usage

let pool = Pool<Snowflake>()

// allocate items
let a = pool.getItem()
let b = pool.getItem()
// Pool<Snowflake> busy: 2 free: 0

// release item
pool.releaseItem(b)
// Pool<Snowflake> busy: 1 free: 1

Author

Dima Pilipenko, dimpiax@gmail.com

License

ObjectPool is available under the MIT license. See the LICENSE file for more info.