Skip to content

Commit

Permalink
Merge pull request #1550 from bendk/uniffi-handle-map-upper-bound
Browse files Browse the repository at this point in the history
Kotlin: Add an upper-bound for UniFfiHandleMap
  • Loading branch information
bendk authored May 22, 2023
2 parents 71c62d8 + 61a8d21 commit cb52566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uniffi_bindgen/src/bindings/kotlin/templates/Helpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public class USize(value: Long = 0) : IntegerType(Native.SIZE_T_SIZE, value, tru
// Rust when it needs an opaque pointer.
//
// TODO: refactor callbacks to use this class
internal class UniFfiHandleMap<T> {
internal class UniFfiHandleMap<T: Any> {
private val map = ConcurrentHashMap<USize, T>()
// Use AtomicInteger for our counter, since we may be on a 32-bit system. 4 billion possible
// values seems like enough. If somehow we generate 4 billion handles, then this will wrap
Expand Down

0 comments on commit cb52566

Please sign in to comment.