Skip to content

Commit df30268

Browse files
committed
use prims to index into ioc state
1 parent 374017a commit df30268

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/main/clojure/clojure/core/async/impl/ioc_macros.clj

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@
3030
(pprint x)
3131
x)
3232

33-
34-
(def ^:const FN-IDX 0)
35-
(def ^:const STATE-IDX 1)
36-
(def ^:const VALUE-IDX 2)
37-
(def ^:const BINDINGS-IDX 3)
38-
(def ^:const EXCEPTION-FRAMES 4)
39-
(def ^:const USER-START-IDX 5)
40-
41-
(defn aset-object [^AtomicReferenceArray arr idx ^Object o]
33+
(def ^{:const true :tag 'long} FN-IDX 0)
34+
(def ^{:const true :tag 'long} STATE-IDX 1)
35+
(def ^{:const true :tag 'long} VALUE-IDX 2)
36+
(def ^{:const true :tag 'long} BINDINGS-IDX 3)
37+
(def ^{:const true :tag 'long} EXCEPTION-FRAMES 4)
38+
(def ^{:const true :tag 'long} USER-START-IDX 5)
39+
40+
(defn aset-object [^AtomicReferenceArray arr ^long idx o]
4241
(.set arr idx o))
4342

44-
(defn aget-object [^AtomicReferenceArray arr idx]
43+
(defn aget-object [^AtomicReferenceArray arr ^long idx]
4544
(.get arr idx))
4645

4746
(defmacro aset-all!

0 commit comments

Comments
 (0)