Skip to content

Commit

Permalink
LayoutManager: using struct tuple in 'cnts' dict
Browse files Browse the repository at this point in the history
  • Loading branch information
luithefirst committed Sep 24, 2024
1 parent 13acf66 commit 1975927
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Aardvark.SceneGraph/Pools/ManagedPool.fs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ module AdaptiveGeometry =
type private LayoutManager<'a>() =
let manager = MemoryManager.createNop()
let store = Dict<'a, managedptr>()
let cnts = Dict<managedptr, 'a * ref<int>>()
let cnts = Dict<managedptr, struct('a * ref<int>)>()

member x.Alloc(key : 'a, size : int) =
match store.TryGetValue key with
| (true, v) ->
let _,r = cnts.[v]
let struct(_,r) = cnts.[v]
Interlocked.Increment &r.contents |> ignore
v
| _ ->
Expand All @@ -85,7 +85,7 @@ type private LayoutManager<'a>() =
member x.TryAlloc(key : 'a, size : int) =
match store.TryGetValue key with
| (true, v) ->
let _,r = cnts.[v]
let struct(_,r) = cnts.[v]
Interlocked.Increment &r.contents |> ignore
false, v
| _ ->
Expand Down

0 comments on commit 1975927

Please sign in to comment.