Struct corundum::default::BuddyAlloc[][src]

pub struct BuddyAlloc {}
Expand description

A memory allocator with buddy allocation mechanism

To define a new buddy allocator type as a memory pool, you may use pool!() macro.

Implementations

Opens a memory pool file and returns an instance of BuddyAlloc if success. The pool remains open as long as the instance lives.

Trait Implementations

Executes the destructor for this type. Read more

Formats the image file

Returns the name of the pool type

Total size of the memory pool

Available space in the pool

Total occupied space

Valid Virtual Address Range

Start of virtual address range

End of virtual address range

Prepares allocation without performing it Read more

Prepares deallocation without performing it Read more

Adds a low-level log to update as 64-bit obj to val when perform() is called. As an example, please see Log::set(). Read more

Adds a low-level DropOnFailure log to perform inside the allocator. This is internally used to atomically allocate a new objects. Calling perform() drops these logs. Read more

Returns the zone index corresponding to a given address

In case of not using pre_alloc or pre_dealloc, starts a low-level atomic section on a given zone. Read more

Performs the prepared operations Read more

Discards the prepared operations Read more

Indicates if the given offset is allocated

Returns a reference to the offset of the first journal

Drops a journal from memory

Runs a closure with a mutable reference to a thread->journal HashMap

Recovers from a crash

Opens a pool and retrieves the root object Read more

Returns true if the pool is open

Opens a new pool without any root object. This function is for testing and is not useful in real applications as none of the allocated objects in persistent region is durable. The reason is that they are not reachable from a root object as it doesn’t exists. All objects can live only in the scope of a transaction. Read more

Commits all changes and clears the logs for all threads Read more

Prints memory information

Applies open pool flags

Translates raw pointers to memory offsets Read more

Acquires a reference pointer to the object Read more

Acquires a mutable reference to the object Read more

Acquires a reference to the slice Read more

Acquires a mutable reference to the slice Read more

Acquires a reference to the object

Acquires a mutable reference pointer to the object

Translates raw pointers to memory offsets

Checks if the reference p belongs to this pool

Checks if addr is in the valid address range if this allocator Read more

Allocate memory as described by the given size. Read more

Deallocate the block of memory at the given ptr pointer with the given size. Read more

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more

Allocates new memory and then places x into it with DropOnFailure log

Allocates a new slice and then places x into it with DropOnAbort log

Allocates new memory and then places x into it without realizing the allocation

Allocates new memory and then places x into it without realizing the allocation

Allocates new memory without copying data

Allocates new memory without copying data

Allocates new memory without copying data and realizing the allocation

Allocates new memory for value x

Creates a DropOnCommit log for the value x

Creates a DropOnCommit log for the value x

Frees the allocation for value x immediately

Commits all changes and clears the logs for one thread Read more

Commits all changes without clearing the logs Read more

Clears the logs Read more

Discards all changes and clears the logs Read more

Discards all changes without clearing the logs Read more

Executes commands atomically with respect to system crashes Read more

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

Performs the conversion.

Performs the conversion.

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.