Drop MMapOpts.MappingIdentity reference in loader.mapSegment.

PiperOrigin-RevId: 200261995
Change-Id: I7e460b18ceab2c23096bdeb7416159d6e774aaf7
This commit is contained in:
Jamie Liu 2018-06-12 12:37:06 -07:00 committed by Shentubot
parent 2dc9cd7bf7
commit 7a10df454b
1 changed files with 5 additions and 0 deletions

View File

@ -271,6 +271,11 @@ func mapSegment(ctx context.Context, m *mm.MemoryManager, f *fs.File, phdr *elf.
Perms: prot,
MaxPerms: usermem.AnyAccess,
}
defer func() {
if mopts.MappingIdentity != nil {
mopts.MappingIdentity.DecRef()
}
}()
if err := f.ConfigureMMap(ctx, &mopts); err != nil {
ctx.Infof("File is not memory-mappable: %v", err)
return err