]> git.proxmox.com Git - libgit2.git/commit - src/pack.c
Share packs across repository instances
authorCarlos Martín Nieto <cmn@dwim.me>
Wed, 18 Jun 2014 15:13:12 +0000 (17:13 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Mon, 23 Jun 2014 19:50:36 +0000 (21:50 +0200)
commitb3b66c57930358467395fc3a5bca87edefd25cf4
tree1ca1c8fd8bf8fd69156c566a83ac12375b427a5e
parent1589aa0c4d48fb130d8a5db28c45cd3d173cde6d
Share packs across repository instances

Opening the same repository multiple times will currently open the same
file multiple times, as well as map the same region of the file multiple
times. This is not necessary, as the packfile data is immutable.

Instead of opening and closing packfiles directly, introduce an
indirection and allocate packfiles globally. This does mean locking on
each packfile open, but we already use this lock for the global mwindow
list so it doesn't introduce a new contention point.
src/indexer.c
src/mwindow.c
src/mwindow.h
src/odb_pack.c
src/pack.c
src/pack.h
tests/pack/sharing.c [new file with mode: 0644]