// Unmap will manually delete the memory mapping of a mapped buffer
Unmap will manually delete the memory mapping of a mapped buffer
// Unmap will manually delete the memory mapping of a mapped buffer
func (b *MemoryMappedWriter) Unmap(removefile bool) error {
	m := mmap.MMap(b.buffer)
	if err := m.Unmap(); err != nil {
		return err
	}
	if err := b.handle.Close(); err != nil {
		return err
	}
	if removefile {
		if err := os.Remove(b.loc); err != nil {
			return err
		}
	}
	return nil
}
func ( b * MemoryMappedWriter ) Unmap ( removefile bool ) error { m := mmap . MMap ( b . buffer ) if err := m . Unmap ( ) ; err != nil { return err } if err := b . handle . Close ( ) ; err != nil { return err } if removefile { if err := os . Remove ( b . loc ) ; err != nil { return err } } return nil }
Unmap will manually delete the memory mapping of a mapped buffer
Unmap will manually delete the memory mapping of a mapped buffer