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

doc file cleanup #494

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: move gc notes from API_CHANGES into CONTRIBUTING
and delete the rest of API_CHANGES
flavorjones committed Jan 29, 2024

Verified

This commit was signed with the committer’s verified signature.
timlegge Timothy Legge
commit 1db44507261aa4da340113acde0306748bd21929
49 changes: 0 additions & 49 deletions API_CHANGES.md

This file was deleted.

22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,28 @@
This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.


## Architecture notes

### Garbage collection

All statements keep pointers back to their respective database connections.
The `@connection` instance variable on the `Statement` handle keeps the database
connection alive. Memory allocated for a statement handler will be freed in
two cases:

1. `#close` is called on the statement
2. The `SQLite3::Database` object gets garbage collected

We can't free the memory for the statement in the garbage collection function
for the statement handler. The reason is because there exists a race
condition. We cannot guarantee the order in which objects will be garbage
collected. So, it is possible that a connection and a statement are up for
garbage collection. If the database connection were to be free'd before the
statement, then boom. Instead we'll be conservative and free unclosed
statements when the connection is terminated.



## Building gems

As a prerequisite please make sure you have `docker` correctly installed, so that you're able to cross-compile the native gems.
2 changes: 0 additions & 2 deletions sqlite3.gemspec
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@ Gem::Specification.new do |s|

s.files = [
".gemtest",
"API_CHANGES.md",
"CHANGELOG.md",
"CONTRIBUTING.md",
"ChangeLog.cvs",
@@ -72,7 +71,6 @@ Gem::Specification.new do |s|
]

s.extra_rdoc_files = [
"API_CHANGES.md",
"CHANGELOG.md",
"README.md",
"ext/sqlite3/aggregator.c",