Skip to content

A simple Swift implementation of an autorelease pool. Autorelease pools help manage memory in situations where objects need to be released at a later point in time. The implementation follows the basic principles of autorelease pools in Objective-C.

Notifications You must be signed in to change notification settings

dworak/AutoreleasePool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Autorelease Pool

A simple Swift implementation of an autorelease pool. Autorelease pools help manage memory in situations where objects need to be released at a later point in time. The implementation follows the basic principles of autorelease pools in Objective-C.

Usage

DispatchQueue.concurrentPerform(iterations: 10) { _ in
  var pool: AutoreleasePool? = AutoreleasePool()
  var object: AnyObject? = TestObject().autorelease()
  pool?.drain()
  pool = nil
}

About

A simple Swift implementation of an autorelease pool. Autorelease pools help manage memory in situations where objects need to be released at a later point in time. The implementation follows the basic principles of autorelease pools in Objective-C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages