Header menu logo XParsec

SmallArrayBuilder<'T> Type

 Stack-allocated builder for small ImmutableArray results (<= 4 items).
 Holds four inline slots and spills to an ImmutableArray.Builder on the 5th item.
 ToImmutable() dispatches to the exact-size ImmutableArray.Create overload for
 small counts, avoiding both the Builder allocation and the size-fitting copy.

 Use as a mutable local:
     let mutable xs = SmallArrayBuilder<'T>()
     xs.Add(item)
     ...
     xs.ToImmutable()

 Single-shot: do not reuse after ToImmutable().
 IsByRefLike forces the struct to stay on the stack — it can't be boxed, captured in
 a closure, stored in a heap field, or cross an async boundary. This prevents the
 silent-copy bugs typical of mutable value types.

Record fields

Record Field Description

count

Full Usage: count

Field type: int
Modifiers: mutable
Field type: int

overflow

Full Usage: overflow

Field type: ImmutableArrayBuilder<'T>
Modifiers: mutable
Field type: ImmutableArrayBuilder<'T>

t0

Full Usage: t0

Field type: 'T
Modifiers: mutable
Field type: 'T

t1

Full Usage: t1

Field type: 'T
Modifiers: mutable
Field type: 'T

t2

Full Usage: t2

Field type: 'T
Modifiers: mutable
Field type: 'T

t3

Full Usage: t3

Field type: 'T
Modifiers: mutable
Field type: 'T

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    item : 'T

item : 'T

this.Count

Full Usage: this.Count

Returns: int
Returns: int

this.ToImmutable

Full Usage: this.ToImmutable

Returns: ImmutableArray<'T>
Returns: ImmutableArray<'T>

Type something to start searching.