Skip to content

Commit 5f645b2

Browse files
Copilotdadhi
andauthored
docs: clarify flat expression node layout helpers
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/f2a1578b-aaf8-4465-9e1f-55f5199c16e4 Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
1 parent 689458f commit 5f645b2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/FastExpressionCompiler.LightExpression/FlatExpression.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public enum ExprNodeKind : byte
4141
ObjectReference,
4242
/// <summary>Represents an internal child-list metadata node.</summary>
4343
ChildList,
44-
/// <summary>Represents an internal pair of ushort values.</summary>
44+
/// <summary>Represents an internal pair of UInt16 values.</summary>
4545
UInt16Pair,
4646
}
4747

48-
/// <summary>Stores one flat expression node plus its intrusive child-link metadata.</summary>
48+
/// <summary>Stores one flat expression node plus its intrusive child-link metadata in 24 bytes on 64-bit runtimes.</summary>
4949
[StructLayout(LayoutKind.Explicit, Size = 24)]
5050
public struct ExprNode
5151
{
@@ -630,6 +630,7 @@ private static ChildList PrependToChildList(int first, int[] rest)
630630
return children;
631631
}
632632

633+
/// <summary>Builds the flat representation while preserving parameter and label identity with stack-friendly maps.</summary>
633634
private struct Builder
634635
{
635636
private SmallMap16<object, int, RefEq<object>> _parameterIds;
@@ -1131,6 +1132,7 @@ private static bool ShouldCloneWhenLinking(in ExprNode node) =>
11311132

11321133
private static bool HasFlag(in ExprNode node, byte flag) => (node.Flags & flag) != 0;
11331134

1135+
/// <summary>Reconstructs System.Linq nodes from the flat representation while reusing parameter and label identities.</summary>
11341136
private struct Reader
11351137
{
11361138
private readonly ExprTree _tree;

0 commit comments

Comments
 (0)