LLDB mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::process_linux::resource_handle::MmapDeleter Class Reference

Custom deleter for the pointer returned by mmap. More...

#include <Perf.h>

Public Member Functions

 MmapDeleter (size_t bytes=0)
 Construct new MmapDeleter.
 
void operator() (void *ptr)
 Unmap the mmap'ed region.
 

Private Attributes

size_t m_bytes
 Size of the mmap'ed region, in bytes, to be unmapped.
 

Detailed Description

Custom deleter for the pointer returned by mmap.

This functor type is provided to unique_ptr to properly unmap the region at destruction time.

Definition at line 33 of file Perf.h.

Constructor & Destructor Documentation

◆ MmapDeleter()

lldb_private::process_linux::resource_handle::MmapDeleter::MmapDeleter ( size_t  bytes = 0)
inline

Construct new MmapDeleter.

Parameters
[in]bytesSize of the mmap'ed region in bytes.

Definition at line 39 of file Perf.h.

Member Function Documentation

◆ operator()()

void resource_handle::MmapDeleter::operator() ( void *  ptr)

Unmap the mmap'ed region.

If m_bytes==0 or ptr==nullptr, nothing is unmmapped.

Parameters
[in]ptrpointer to the region to be unmmapped.

Definition at line 64 of file Perf.cpp.

References m_bytes.

Member Data Documentation

◆ m_bytes

size_t lldb_private::process_linux::resource_handle::MmapDeleter::m_bytes
private

Size of the mmap'ed region, in bytes, to be unmapped.

Definition at line 51 of file Perf.h.

Referenced by operator()().


The documentation for this class was generated from the following files: