summaryrefslogtreecommitdiff
path: root/sys/src/cmd/git/git.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2022-01-02 03:37:23 +0000
committerOri Bernstein <ori@eigenstate.org>2022-01-02 03:37:23 +0000
commitf63d1d3ced81702e0eadf56228a54a467278b0d4 (patch)
tree6b56699383c1146d7e65f37fad027f6bcecac3d5 /sys/src/cmd/git/git.h
parent99d54e420ed021a738d9f835f5949e78202c3b2e (diff)
git: size cache in bytes, not objects
git used to track cache size in object count, rather than bytes. This had the unfortunate effect of making memory use depend on the size of objects -- repos with lots of large objects could cause out of memory deaths. now, we track sizes in bytes, which should keep our memory usage flatter.
Diffstat (limited to 'sys/src/cmd/git/git.h')
-rw-r--r--sys/src/cmd/git/git.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/cmd/git/git.h b/sys/src/cmd/git/git.h
index 839fcfe60..74617939d 100644
--- a/sys/src/cmd/git/git.h
+++ b/sys/src/cmd/git/git.h
@@ -4,6 +4,7 @@
#include <flate.h>
#include <regexp.h>
+typedef struct Capset Capset;
typedef struct Conn Conn;
typedef struct Hash Hash;
typedef struct Delta Delta;
@@ -26,6 +27,8 @@ enum {
Npackcache = 32,
Hashsz = 20,
Pktmax = 65536,
+ KiB = 1024,
+ MiB = 1024*KiB,
};
enum {
@@ -241,9 +244,9 @@ struct Delta {
extern Reprog *authorpat;
extern Objset objcache;
+extern vlong cachemax;
extern Hash Zhash;
extern int chattygit;
-extern int cachemax;
extern int interactive;
#pragma varargck type "H" Hash