Represents a chunk of memory that can be allocated and deallocated.
More...
#include <arena.hpp>
|
bool | fits (std::size_t bytes) const |
| Is this block large enough to fit bytes bytes? More...
|
|
bool | is_contiguous_before (block const &blk) const |
| Verifies whether this block can be merged to the beginning of block blk. More...
|
|
std::pair< block, block > | split (std::size_t bytes) const |
| Split this block into two by the given size. More...
|
|
block | merge (block const &blk) const |
| Coalesce two contiguous blocks into one. More...
|
|
| byte_span ()=default |
| Construct a default span.
|
|
| byte_span (void *pointer, std::size_t size) |
| Construct a span given a pointer and size. More...
|
|
| byte_span ()=default |
| Construct a default span.
|
|
| byte_span (void *pointer, std::size_t size) |
| Construct a span given a pointer and size. More...
|
|
char * | pointer () const |
| Returns the underlying pointer.
|
|
std::size_t | size () const |
| Returns the size of the span.
|
|
char * | end () const |
| Returns the end of the span.
|
|
bool | is_valid () const |
| Returns true if this span is valid (non-null), false otherwise.
|
|
bool | operator< (byte_span const &span) const |
| Used by std::set to compare spans.
|
|
Represents a chunk of memory that can be allocated and deallocated.
◆ byte_span()
rmm::mr::detail::arena::byte_span::byte_span |
|
inline |
Construct a span given a pointer and size.
- Parameters
-
pointer | The address for the beginning of the span. |
size | The size of the span. |
◆ fits()
bool rmm::mr::detail::arena::block::fits |
( |
std::size_t |
bytes | ) |
const |
|
inline |
Is this block large enough to fit bytes
bytes?
- Parameters
-
bytes | The size in bytes to check for fit. |
- Returns
- true if this block is at least
bytes
bytes.
◆ is_contiguous_before()
bool rmm::mr::detail::arena::block::is_contiguous_before |
( |
block const & |
blk | ) |
const |
|
inline |
Verifies whether this block can be merged to the beginning of block blk.
- Parameters
-
blk | The block to check for contiguity. |
- Returns
- true Returns true if this block's
pointer
+ size
== blk.pointer
.
◆ merge()
block rmm::mr::detail::arena::block::merge |
( |
block const & |
blk | ) |
const |
|
inline |
Coalesce two contiguous blocks into one.
this->is_contiguous_before(blk)
must be true.
- Parameters
-
- Returns
- block The merged block.
◆ split()
std::pair<block, block> rmm::mr::detail::arena::block::split |
( |
std::size_t |
bytes | ) |
const |
|
inline |
Split this block into two by the given size.
- Parameters
-
bytes | The size in bytes of the first block. |
- Returns
- std::pair<block, block> A pair of blocks split by bytes.
The documentation for this class was generated from the following file: