Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more sophisticated ID generation for internal handles #13

Closed
zombiezen opened this issue May 22, 2021 · 0 comments
Closed

Use more sophisticated ID generation for internal handles #13

zombiezen opened this issue May 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@zombiezen
Copy link
Owner

zombiezen commented May 22, 2021

Right now, there's a number of Go objects (i.e. user-defined functions and auxiliary data) that get "passed" through the SQLite library via a uintptr ID in a process-wide table. The way I generate these IDs is by simply incrementing an integer. For 64-bit systems, the probability of ID wraparound issues is exceedingly low, but it might be possible for high-volume applications on 32-bit systems to have collisions.

My observation is that the number of handles present at one time for any of these objects is relatively low (likely worst case low 100s), so I'm thinking a simple bitset would work well.

@zombiezen zombiezen added the bug Something isn't working label May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant