summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-06-03 14:55:58 +0000
committerRich Hickey <richhickey@gmail.com>2006-06-03 14:55:58 +0000
commit0f70b780b29908ef7d5088907413f10530e89a2f (patch)
tree2b89b94651a30ba98678d978c00865ca8bda6e32 /src
parenta70e9347a643ad90827dc5837f937a7ee7e12db9 (diff)
got rid of clone in TVal
Diffstat (limited to 'src')
-rw-r--r--src/cli/runtime/TVal.cs18
-rw-r--r--src/org/clojure/runtime/TVal.java18
2 files changed, 30 insertions, 6 deletions
diff --git a/src/cli/runtime/TVal.cs b/src/cli/runtime/TVal.cs
index 05b502e9..8f17bb8f 100644
--- a/src/cli/runtime/TVal.cs
+++ b/src/cli/runtime/TVal.cs
@@ -19,10 +19,22 @@ internal volatile Object val;
internal volatile Transaction.Info tinfo;
internal volatile TVal prior;
+internal TVal(){
+
+}
+
+internal TVal(Object val, Transaction.Info tinfo, TVal prior) {
+ this.val = val;
+ this.tinfo = tinfo;
+ this.prior = prior;
+}
+
internal void push(Object val,Transaction.Info tinfo) {
- if(tinfo != null) //not newly created
- this.prior = (TVal) this.MemberwiseClone();
- this.tinfo = tinfo;
+ if(tinfo != null) //not newly created, clone tval part
+ {
+ this.prior = new TVal(this.val,this.tinfo,this.prior);
+ }
+ this.tinfo = tinfo;
this.val = val;
}
diff --git a/src/org/clojure/runtime/TVal.java b/src/org/clojure/runtime/TVal.java
index edcd330d..1bc72a9b 100644
--- a/src/org/clojure/runtime/TVal.java
+++ b/src/org/clojure/runtime/TVal.java
@@ -17,10 +17,22 @@ volatile Object val;
volatile Transaction.Info tinfo;
volatile TVal prior;
+TVal(){
+
+}
+
+TVal(Object val, Transaction.Info tinfo, TVal prior) {
+ this.val = val;
+ this.tinfo = tinfo;
+ this.prior = prior;
+}
+
void push(Object val,Transaction.Info tinfo) throws Exception{
- if(tinfo != null) //not newly created
- this.prior = (TVal) this.clone();
- this.tinfo = tinfo;
+ if(tinfo != null) //not newly created, clone tval part
+ {
+ this.prior = new TVal(this.val,this.tinfo,this.prior);
+ }
+ this.tinfo = tinfo;
this.val = val;
}