Skip to content
Snippets Groups Projects
Commit 5da15d1a authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[region] stabilization of region counters

parent f692ccac
No related branches found
No related tags found
No related merge requests found
...@@ -27,18 +27,20 @@ ...@@ -27,18 +27,20 @@
module Imap = Map.Make(Int) module Imap = Map.Make(Int)
type 'a rref = int type 'a rref = int
type 'a store = 'a Imap.t ref type 'a store = {
mutable rid : int ;
mutable map : 'a Imap.t ;
}
let new_store () = ref Imap.empty let new_store () = { rid = 0 ; map = Imap.empty }
let copy r = ref !r let copy r = { rid = r.rid ; map = r.map }
let rid = ref 0
let make s v = let make s v =
let k = incr rid ; !rid in let k = succ s.rid in
s := Imap.add k v !s ; k s.rid <- k ; s.map <- Imap.add k v s.map ; k
let get s k = Imap.find k !s let get s k = Imap.find k s.map
let set s k v = s := Imap.add k v !s let set s k v = s.map <- Imap.add k v s.map
let eq _s i j = (i == j) let eq _s i j = (i == j)
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
R0004: --- 0b ; R0004: --- 0b ;
R0001: -W- p (int *) 64b (*R0004) ; R0001: -W- p (int *) 64b (*R0004) ;
[region] Function struct_blob: [region] Function struct_blob:
R0009: --- y 64b 0..32 [0]: R000a ; R0003: --- y 64b 0..32 [0]: R0004 ;
R000a: --- 0b ; R0004: --- 0b ;
R0007: -W- p (int *) 64b (*R000a) ; R0001: -W- p (int *) 64b (*R0004) ;
[region] Function var_blob: [region] Function var_blob:
R000f: --- x 0b ; R0003: --- x 0b ;
R000d: -W- p (int *) 64b (*R000f) ; R0001: -W- p (int *) 64b (*R0003) ;
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
R0001: R-- b (int *) 64b (*R0007) ; R0001: R-- b (int *) 64b (*R0007) ;
R0008: RW- tmp (int) 32b ; R0008: RW- tmp (int) 32b ;
[region] Function swap_separated: [region] Function swap_separated:
R0013: R-- a (int *) 64b (*R0016) ; R0001: R-- a (int *) 64b (*R0004) ;
R0016: RW- A: (int) 32b ; R0004: RW- A: (int) 32b ;
R0017: R-- b (int *) 64b (*R001a) ; R0005: R-- b (int *) 64b (*R0008) ;
R001a: RW- B: (int) 32b ; R0008: RW- B: (int) 32b ;
R001b: RW- tmp (int) 32b ; R0009: RW- tmp (int) 32b ;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment