-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Bugfix / Performance: Memory leak - always allocating new memor…
…y for font characters (mono#64) Bugfix / Performance: Memory leak - always allocating new memory for font characters
- Loading branch information
Showing
9 changed files
with
102 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ steps: | |
continueOnError: true | ||
- script: esy install | ||
- script: esy build | ||
- script: esy b dune runtest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
open Rejest; | ||
|
||
open Revery_Core; | ||
|
||
test("Memoize", () => { | ||
test("Simple memoization", () => { | ||
let v = ref(0); | ||
let testFunction = | ||
Memoize.make(_a => { | ||
v := v^ + 1; | ||
v^; | ||
}); | ||
|
||
let t0 = testFunction(0); | ||
let t1 = testFunction(0); | ||
|
||
expect(t0).toEqual(1); | ||
expect(t1).toEqual(1); | ||
}); | ||
|
||
test("Memoizes multiple arguments", () => { | ||
let v = ref(0); | ||
let testFunction = | ||
Memoize.make(a => { | ||
v := v^ + 1; | ||
a ++ string_of_int(v^); | ||
}); | ||
|
||
let t0 = testFunction("a"); | ||
let t1 = testFunction("b"); | ||
let t2 = testFunction("a"); | ||
let t3 = testFunction("b"); | ||
|
||
expect(t0).toEqual("a1"); | ||
expect(t1).toEqual("b2"); | ||
expect(t2).toEqual("a1"); | ||
expect(t3).toEqual("b2"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(library | ||
(name Revery_Core_Test) | ||
(library_flags (-linkall)) | ||
(modules (:standard)) | ||
(libraries Revery_Core rejest)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Rejest.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(executable | ||
(name TestRunner) | ||
(libraries | ||
rejest | ||
Revery_Core_Test | ||
)) | ||
|
||
(alias | ||
(name runtest) | ||
(action (run ./TestRunner.exe))) |