pub struct AtomicBitmap { /* private fields */ }
Expand description

AtomicBitmap implements a simple bit map on the page level with test and set operations. It is page-size aware, so it converts addresses to page numbers before setting or clearing the bits.

Implementations

Create a new bitmap of byte_size, with one bit per page. This is effectively rounded up, and we get a new vector of the next multiple of 64 bigger than bit_size.

Is bit n set? Bits outside the range of the bitmap are always unset.

Is the bit corresponding to address addr set?

Set a range of len bytes starting at start_addr. The first bit set in the bitmap is for the page corresponding to start_addr, and the last bit that we set corresponds to address start_addr + len - 1.

Get the length of the bitmap in bits (i.e. in how many pages it can represent).

Atomically get and reset the dirty page bitmap.

Reset all bitmap bits to 0.

Trait Implementations

Mark the memory range specified by the given offset and len as dirtied.
Check whether the specified offset is marked as dirty.
Return a <Self as WithBitmapSlice>::S slice of the current bitmap, starting at the specified offset. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Create a new object based on the specified length in bytes.
Type of the bitmap slice.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.