Skip to content

[C++] When MemoryMappedFile is destructed, memory is unmapped even if buffer referecnes still exist #15346

@asfimport

Description

@asfimport

I'd like to see if there is some way to "protect" the memory map from premature destruction. This is a slight artifact of MemoryMappedFile's implementation sharing code with normal on-disk files (which read into allocated memory), i.e. the Close function unmaps the memory and closes the file handle. This would amount to creating a Buffer subclass that retains ownership of the file descriptor and memory map, so that if any Buffer still references the memory map, then MemoryMappedFile::Close will not unmap the memory or close the file. But then the unmapping / file close would need to happen when the last Buffer reference is destroyed.

Reporter: Wes McKinney / @wesm
Assignee: Wes McKinney / @wesm

Note: This issue was originally created as ARROW-494. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions