]> source.dussan.org Git - jgit.git/commit
UInt24Array: Array of unsigned ints encoded in 3 bytes. 92/199892/3
authorIvan Frade <ifrade@google.com>
Fri, 10 Feb 2023 20:21:01 +0000 (12:21 -0800)
committerIvan Frade <ifrade@google.com>
Tue, 14 Feb 2023 18:19:12 +0000 (10:19 -0800)
commit62d0e7be7c2a3c72e50dd9474ea72dfd7ec586b9
tree94d33069d3d6f98204340f59281bb78d2ed494aa
parent5b9ca7df42c0524140e24faec73d663beb7202fb
UInt24Array: Array of unsigned ints encoded in 3 bytes.

The object size index stores positions of objects in the main
index (when ordered by sha1). These positions are per-pack and usually
a pack has <16 million objects (there are exceptions but rather
rare). It could save some memory storing these positions in three bytes
instead of four. Note that these positions are sorted and always positive.

Implement a wrapper around a byte[] to access and search "ints" while
they are stored as unsigned 3 bytes.

Change-Id: Iaa26ce8e2272e706e35fe4cdb648fb6ca7591972
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UInt24ArrayTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UInt24Array.java [new file with mode: 0644]