Skip to content

Commit fc63f0c

Browse files
authored
Fix memory allocations counters on macOS. (#2673)
Motivation: Allocation counters are broken on macOS as described [here](#2672). This PR fixes it. Modifications: `AtomicCounter` library is made `.dynamic`. This deduplicates the two (static) copies that used to exist. One embedded in the main binary, and the other in `HookedFunctions` dylib. This deplication fixes the issue, because there is just one copy of the counters in the process address space. Result: All the tests counting allocations and related statistics work on macOS.
1 parent 5e47077 commit fc63f0c

File tree

1 file changed

+1
-1
lines changed
  • IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter

1 file changed

+1
-1
lines changed

IntegrationTests/allocation-counter-tests-framework/template/AtomicCounter/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import PackageDescription
1919
let package = Package(
2020
name: "AtomicCounter",
2121
products: [
22-
.library(name: "AtomicCounter", targets: ["AtomicCounter"]),
22+
.library(name: "AtomicCounter", type: .dynamic, targets: ["AtomicCounter"]),
2323
],
2424
dependencies: [ ],
2525
targets: [

0 commit comments

Comments
 (0)