Title: [WIP] Cache repository / owner values in persistent handle by srajko · Pull Request #962 · nodegit/nodegit · GitHub
Open Graph Title: [WIP] Cache repository / owner values in persistent handle by srajko · Pull Request #962 · nodegit/nodegit
X Title: [WIP] Cache repository / owner values in persistent handle by srajko · Pull Request #962 · nodegit/nodegit
Description: This works towards #955. Once we free repositories on wrapper GC, any object that can return a repository (for example, a GitCommit) can potentially return a freed repository. This PR adds persistent handles to any object that returns a repository. Once we enforce a 1-1 relationship between git_repository objects and GitRepository wrappers, this will ensure that the wrapper does not get GCd until all objects that can return the repository can get GCed as well. The stand-alone benefit of this PR is just that we don't create a new wrapper each time we return a repository from an object. Also, the caching mechanism might be helpful beyond holding a handle - we can extend it to cache any similar value and avoid calling into the libgit2 layer for sync functions (this can help with thread safety without requiring locking).
Open Graph Description: This works towards #955. Once we free repositories on wrapper GC, any object that can return a repository (for example, a GitCommit) can potentially return a freed repository. This PR adds persis...
X Description: This works towards #955. Once we free repositories on wrapper GC, any object that can return a repository (for example, a GitCommit) can potentially return a freed repository. This PR adds persis...
Opengraph URL: https://github.com/nodegit/nodegit/pull/962
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:10255bc9-d12e-192d-2052-071ae676a17c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E2F0:3F18FE:3A6E911:4C00C91:6975052A |
| html-safe-nonce | de08329fdd0ee037f77216c7f8e54ee03199718f42c9546222e8a0844abddd4e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkYwOjNGMThGRTozQTZFOTExOjRDMDBDOTE6Njk3NTA1MkEiLCJ2aXNpdG9yX2lkIjoiMzIwNzYxOTI1Nzg5MzcxNzI5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5454df77e4b05b0ac630c0acc6a833d6691809b4bb5bd31439c07ebc97596b92 |
| hovercard-subject-tag | pull_request:63814835 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodegit/nodegit/pull/962/files |
| twitter:image | https://avatars.githubusercontent.com/u/291007?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/291007?s=400&v=4 |
| og:image:alt | This works towards #955. Once we free repositories on wrapper GC, any object that can return a repository (for example, a GitCommit) can potentially return a freed repository. This PR adds persis... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width