Rewrite ZipOS

This reduces the virtual memory usage of Emacs for me by 30%. We now
have a simpler implementation that uses read(), rather mmap()ing the
whole executable.
This commit is contained in:
Justine Tunney 2023-10-03 07:27:25 -07:00
parent ff77f2a6af
commit b01282e23e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
21 changed files with 408 additions and 421 deletions

View file

@ -36,6 +36,8 @@
#define kZipErrorRaceCondition _ZE(-12)
#define kZipErrorMapFailed _ZE(-13)
#define kZipErrorOpenFailed _ZE(-14)
#define kZipErrorReadFailed _ZE(-15)
#define kZipErrorZipCorrupt _ZE(-16)
#define kZipCosmopolitanVersion kZipEra2001
@ -70,6 +72,8 @@
#define kZipCompressionNone 0
#define kZipCompressionDeflate 8
#define kZipLookbehindBytes 65536
#define kZipCdirHdrMagic ZM_(0x06054b50) /* PK♣♠ "PK\5\6" */
#define kZipCdirHdrMagicTodo ZM_(0x19184b50) /* PK♣♠ "PK\30\31" */
#define kZipCdirHdrMinSize 22