mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
bind: split out Seq.getRef calls with Go references
Today, the Seq.Ref class has two purposes. For Java references, Ref contains the refnum, a reference to the Java object and a reference count. For Go references, Ref contains the refnum and its finalizer makes sure to decrement the reference count on the Go side. The next CL will replace the use of finalizers with an explicit ReferenceQueue of Go references, and the Ref class will no longer be used for Go refences. To prepare for that, this CL pulls up the construction of Go referencing Ref instances into the Seq.trackGoRef function. Change-Id: I9eefe238cd3fd1b661b2af11d331a2f61e31303b Reviewed-on: https://go-review.googlesource.com/106875 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Vendored
+5
-5
@@ -92,7 +92,7 @@ public abstract class Java {
|
||||
return refnum;
|
||||
}
|
||||
|
||||
proxyF(Seq.Ref ref) { this.ref = ref; }
|
||||
proxyF(int refnum) { this.ref = Seq.trackGoRef(refnum); }
|
||||
|
||||
public native String toString();
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public abstract class Java {
|
||||
return refnum;
|
||||
}
|
||||
|
||||
proxyL(Seq.Ref ref) { this.ref = ref; }
|
||||
proxyL(int refnum) { this.ref = Seq.trackGoRef(refnum); }
|
||||
|
||||
public native String toString();
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public abstract class Java {
|
||||
return refnum;
|
||||
}
|
||||
|
||||
proxyO(Seq.Ref ref) { this.ref = ref; }
|
||||
proxyO(int refnum) { this.ref = Seq.trackGoRef(refnum); }
|
||||
|
||||
public native String toString();
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public abstract class Java {
|
||||
return refnum;
|
||||
}
|
||||
|
||||
proxyR(Seq.Ref ref) { this.ref = ref; }
|
||||
proxyR(int refnum) { this.ref = Seq.trackGoRef(refnum); }
|
||||
|
||||
}
|
||||
private static final class proxyS implements Seq.Proxy, S {
|
||||
@@ -143,7 +143,7 @@ public abstract class Java {
|
||||
return refnum;
|
||||
}
|
||||
|
||||
proxyS(Seq.Ref ref) { this.ref = ref; }
|
||||
proxyS(int refnum) { this.ref = Seq.trackGoRef(refnum); }
|
||||
|
||||
public native String toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user