AllocFlag

Allocation-related flags dictated by type characteristics. TypedAllocator deduces these flags from the type being allocated and uses the appropriate allocator accordingly.

Values

ValueMeaning
_init0
fixedSize1

Fixed-size allocation (unlikely to get reallocated later). Examples: int, double, any struct or class type. By default it is assumed that the allocation is variable-size, i.e. susceptible to later reallocation (for example all array types). This flag is advisory, i.e. in-place resizing may be attempted for fixedSize allocations and may succeed. The flag is just a hint to the compiler it may use allocation strategies that work well with objects of fixed size.

hasNoIndirections4

The type being allocated embeds no pointers. Examples: int, int[], Tuple!(int, float). The implicit conservative assumption is that the type has members with indirections so it needs to be scanned if garbage collected. Example of types with pointers: int*[], Tuple!(int, string).

immutableShared8

By default it is conservatively assumed that allocated memory may be cast to shared, passed across threads, and deallocated in a different thread than the one that allocated it. If that's not the case, there are two options. First, immutableShared means the memory is allocated for immutable data and will be deallocated in the same thread it was allocated in. Second, threadLocal means the memory is not to be shared across threads at all. The two flags cannot be simultaneously present.

threadLocal16

ditto

Meta