Overhead of an actor

With default features on a 64-bit platform, an actor requires one allocation of 48 + Self bytes for the actor, and a second allocation of 8 bytes for the termination notifier. The details follow:

The table below shows the sizes requested from malloc, so include the internal data used by the reference-counting implementation.

Features1000-byte actorOverheadNotifier0-byte actor
default104848872
no-unsafe105656880
all features1080808104

The Overhead column shows the bytes used above the actor's own Self instance size.

The Notifier column shows the bytes required for a simple Ret instance created using ret_to! to notify a parent of the termination of this actor. This is a separate allocation because it is variable-sized in general. Note that the Notifier overhead is optional, as you can use ret_nop! which avoids that allocation, but normally it will be required.

Regarding the 0-byte actor column: The actor's Self structure is in a union with a FnOnce queue, so Self structures smaller than 24 bytes still consume the minimum 24 bytes.