packed: add ability to load from memory, add MapAndLoad
The ability to load a packfile from memory means that it becomes easy to use the "embed" package to embed a small packfile. The refactor to allow loading from memory also makes it easy to add a MapAndLoad implementation, which means the file only needs to be opened / mmap()ed once.
This commit is contained in:
parent
96ea58d32b
commit
4ed5335a07
4 changed files with 154 additions and 33 deletions
BIN
packed/testdata/helloworld.pack
vendored
Normal file
BIN
packed/testdata/helloworld.pack
vendored
Normal file
Binary file not shown.
13
packed/testdata/helloworld.txt
vendored
Normal file
13
packed/testdata/helloworld.txt
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Hello, world
|
||||
|
||||
This file contains a few lines of plain text, really just enough
|
||||
to trigger the "compression worthwhile" heuristic.
|
||||
|
||||
This file contains a few lines of plain text, really just enough
|
||||
to trigger the "compression worthwhile" heuristic.
|
||||
|
||||
This file contains a few lines of plain text, really just enough
|
||||
to trigger the "compression worthwhile" heuristic.
|
||||
|
||||
This file contains a few lines of plain text, really just enough
|
||||
to trigger the "compression worthwhile" heuristic.
|
||||
Loading…
Add table
Add a link
Reference in a new issue