Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotInitialized = errors.New("file is not initialized") ErrAlreadyClosed = errors.New("file is already closed") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { Add(K, V) Get(K) (V, bool) Peek(K) (V, bool) Remove(K) Purge() }
type ObjectFile ¶
type ObjectFile struct { BuildID string Path string Size int64 Modtime time.Time // If exists, will be released when the parent ObjectFile is released. // Go GC with a finalizer works correctly even with cyclic references. DebugFile *ObjectFile // contains filtered or unexported fields }
ObjectFile represents an executable or library file. It handles the lifetime of the underlying file descriptor.
func (*ObjectFile) ELF ¶ added in v0.20.0
func (o *ObjectFile) ELF() (*elf.File, error)
ELF returns the ELF file for the object file. Parallel reads are allowed.
func (*ObjectFile) Reader ¶ added in v0.20.0
func (o *ObjectFile) Reader() (*io.SectionReader, error)
Reader returns a reader for the file. Parallel reads are NOT allowed. The caller must call the returned function when done with the reader.
type Pool ¶ added in v0.20.0
type Pool struct {
// contains filtered or unexported fields
}
func NewPool ¶ added in v0.20.0
func NewPool(logger log.Logger, reg prometheus.Registerer, evictionPolicy string, poolSize int, profilingDuration time.Duration) *Pool
func (*Pool) NewFile ¶ added in v0.20.0
func (p *Pool) NewFile(f *os.File) (_ *ObjectFile, err error)
NewFile creates a new ObjectFile reference from an existing file. The returned reference should be released after use. The file will be closed when the reference is released.
func (*Pool) Open ¶ added in v0.20.0
func (p *Pool) Open(path string) (*ObjectFile, error)
Open opens the specified executable or library file from the given path. And creates a new ObjectFile reference. The returned reference should be released after use. The file will be closed when the reference is released.