File tree Expand file tree Collapse file tree 3 files changed +22
-51
lines changed Expand file tree Collapse file tree 3 files changed +22
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.
66
77
8+ ## Architecture notes
9+
10+ ### Garbage collection
11+
12+ All statements keep pointers back to their respective database connections.
13+ The ` @connection ` instance variable on the ` Statement ` handle keeps the database
14+ connection alive. Memory allocated for a statement handler will be freed in
15+ two cases:
16+
17+ 1 . ` #close ` is called on the statement
18+ 2 . The ` SQLite3::Database ` object gets garbage collected
19+
20+ We can't free the memory for the statement in the garbage collection function
21+ for the statement handler. The reason is because there exists a race
22+ condition. We cannot guarantee the order in which objects will be garbage
23+ collected. So, it is possible that a connection and a statement are up for
24+ garbage collection. If the database connection were to be free'd before the
25+ statement, then boom. Instead we'll be conservative and free unclosed
26+ statements when the connection is terminated.
27+
28+
29+
830## Building gems
931
1032As a prerequisite please make sure you have ` docker ` correctly installed, so that you're able to cross-compile the native gems.
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ Gem::Specification.new do |s|
3737
3838 s . files = [
3939 ".gemtest" ,
40- "API_CHANGES.md" ,
4140 "CHANGELOG.md" ,
4241 "CONTRIBUTING.md" ,
4342 "ChangeLog.cvs" ,
@@ -72,7 +71,6 @@ Gem::Specification.new do |s|
7271 ]
7372
7473 s . extra_rdoc_files = [
75- "API_CHANGES.md" ,
7674 "CHANGELOG.md" ,
7775 "README.md" ,
7876 "ext/sqlite3/aggregator.c" ,
You can’t perform that action at this time.
0 commit comments