mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
seccheck: Initialize seccheck.Points only when needed.
This moves the initialization of `seccheck.Points` out of package-level `init` and instead moves it to an explicit `seccheck.Initialize()` function. On AMD64, this saves about 614KiB of heap memory that would otherwise always be live. PiperOrigin-RevId: 514813332
This commit is contained in:
committed by
gVisor bot
parent
6d59ef7202
commit
d9fcdc7714
@@ -30,6 +30,7 @@ go_library(
|
||||
"//pkg/sentry/platform",
|
||||
"//pkg/sentry/platform/kvm",
|
||||
"//pkg/sentry/platform/ptrace",
|
||||
"//pkg/sentry/seccheck",
|
||||
"//pkg/sentry/time",
|
||||
"//pkg/sentry/vfs",
|
||||
"//pkg/sync",
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/sentry/mm"
|
||||
"gvisor.dev/gvisor/pkg/sentry/pgalloc"
|
||||
"gvisor.dev/gvisor/pkg/sentry/platform"
|
||||
"gvisor.dev/gvisor/pkg/sentry/seccheck"
|
||||
"gvisor.dev/gvisor/pkg/sentry/time"
|
||||
"gvisor.dev/gvisor/pkg/sentry/vfs"
|
||||
|
||||
@@ -49,6 +50,8 @@ var (
|
||||
|
||||
// Boot initializes a new bare bones kernel for test.
|
||||
func Boot() (*kernel.Kernel, error) {
|
||||
seccheck.Initialize()
|
||||
|
||||
platformCtr, err := platform.Lookup(*platformFlag)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("platform not found: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user