Skip to content

Commit 3a0910f

Browse files
committed
Force garbage collection once the managed object pool is being de-initialized. Bump version to 1.4.1.
1 parent e9c3d55 commit 3a0910f

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

Diff for: CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.4.1 (2018-06-23)
4+
- Fix memory leaks
5+
- Provide a comfortable command-line interface supporting both a read-eval-print loop and the execution of scripts
6+
- Prelude and libraries path preferences are now handled correctly and do not result in access issues anymore
7+
- Programs blocking on functions like `read` can now be terminated
8+
- Minor bugs in bitwise operations for exact integers of arbitrary size fixed
9+
- `string-split` now returns a list instead of a vector
10+
- Complete rewrite of the error reporting subsystem, including support for `file-error?` and `read-error?`
11+
- New library: `(lispkit test)`
12+
- New SRFI libraries: SRFI 69, SRFI 129, SRFI 137, SRFI 145, SRFI 151
13+
- New example code for coroutines, HTTP support, and a small compiler for arithmetic expressions
14+
315
## 1.4 (2018-03-30)
416
- Migrated project to Xcode 9.3 and Swift 4
517
- Bug fixes (esp. in `syntax-rules`)

Diff for: Sources/LispKit/Base/ManagedObjectPool.swift

+16-1
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,27 @@ public final class ManagedObjectPool: CustomStringConvertible {
4242
/// Pool of managed objects.
4343
private var objectPool: ObjectPool<ManagedObject>
4444

45+
/// Does this managed object pool own the managed objects? If yes, the objects will be
46+
/// cleaned as soon as this managed object pool is being de-initialized.
47+
private let ownsManagedObjects: Bool
48+
4549
/// Initializes an empty managed object pool.
46-
public init() {
50+
public init(ownsManagedObjects: Bool = true) {
4751
self.tag = 0
4852
self.cycles = 0
4953
self.rootSet = ObjectPool<TrackedObject>()
5054
self.objectPool = ObjectPool<ManagedObject>()
55+
self.ownsManagedObjects = ownsManagedObjects
56+
}
57+
58+
/// Destory all potential cyclic dependencies if this managed object pool owns the managed
59+
/// objects.
60+
deinit {
61+
if self.ownsManagedObjects {
62+
for obj in self.objectPool {
63+
obj.clean()
64+
}
65+
}
5166
}
5267

5368
/// Returns number of tracked objects.

Diff for: Sources/LispKit/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.4.0</string>
18+
<string>1.4.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Diff for: Sources/LispKitRepl/main.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var cmdLineArgs = flags.parameters.isEmpty ? [CommandLine.arguments.first!] : fl
123123
#if SPM
124124
let context = Context(console: console,
125125
implementationName: "LispKit",
126-
implementationVersion: "1.4.0",
126+
implementationVersion: "1.4.1",
127127
commandLineArguments: cmdLineArgs,
128128
includeInternalResources: false,
129129
includeDocumentPath: searchDocs.wasSet ? "LispKit" : nil)

0 commit comments

Comments
 (0)