Struct coco::epoch::Garbage [] [src]

pub struct Garbage { /* fields omitted */ }
Deprecated since 0.2.0

: Use scope::defer_free and scope::defer_drop instead

A garbage queue.

This is where a concurrent data structure can store removed objects for deferred destruction.

Stored garbage objects are first kept in the garbage buffer. When the buffer becomes full, it's objects are flushed into the garbage queue. Flushing can be manually triggered by calling flush.

Some garbage in the queue can be manually collected by calling collect.

Methods

impl Garbage
[src]

Returns a new, empty garbage queue.

Adds an object that will later be freed.

The specified object is an array allocated at address object and consists of count elements of type T.

This method inserts the object into the garbage buffer. When the buffers becomes full, it's objects are flushed into the garbage queue.

Adds an object that will later be dropped and freed.

The specified object is an array allocated at address object and consists of count elements of type T.

This method inserts the object into the garbage buffer. When the buffers becomes full, it's objects are flushed into the garbage queue.

Note: The object must be Send + 'self.

Adds an object that will later be destroyed using destroy.

The specified object is an array allocated at address object and consists of count elements of type T.

This method inserts the object into the garbage buffer. When the buffers becomes full, it's objects are flushed into the garbage queue.

Note: The object must be Send + 'self.

Flushes the buffered garbage.

It is wise to flush the garbage just after passing a very large object to one of the defer_* methods, so that it isn't sitting in the buffer for a long time.

Collects some garbage from the queue and destroys it.

Generally speaking, it's not necessary to call this method because garbage production already triggers garbage destruction. However, if there are long periods without garbage production, it might be a good idea to call this method from time to time.

This method collects several buffers worth of garbage objects.

Trait Implementations

impl Send for Garbage
[src]

impl Sync for Garbage
[src]

impl Drop for Garbage
[src]

A method called when the value goes out of scope. Read more

impl Debug for Garbage
[src]

Formats the value using the given formatter.