helper/bwrap: allocate large args slice
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
6acd0d4e88
commit
55d83eb9b0
@ -54,6 +54,11 @@ func (c *Config) Args() (args []string) {
|
|||||||
c.pairArgs(),
|
c.pairArgs(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* this is only 8 KiB of memory on a 64-bit system,
|
||||||
|
permissive defaults on NixOS results in around 200 args
|
||||||
|
so this capacity should eliminate copies for most setups */
|
||||||
|
args = make([]string, 0, 512)
|
||||||
|
|
||||||
// copy FSBuilder slice to builder slice
|
// copy FSBuilder slice to builder slice
|
||||||
fb := make([]Builder, len(c.Filesystem)+1)
|
fb := make([]Builder, len(c.Filesystem)+1)
|
||||||
for i, f := range c.Filesystem {
|
for i, f := range c.Filesystem {
|
||||||
|
Loading…
Reference in New Issue
Block a user