Skip to content

Commit 074e05c

Browse files
committed
RoutineInfo.Invoke() with 1 argument without alloc
1 parent b3aff57 commit 074e05c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Peachpie.Runtime/Reflection/PhpRoutineInfo.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Linq;
77
using System.Linq.Expressions;
88
using System.Reflection;
9+
using System.Runtime.InteropServices;
910
using System.Text;
1011
using System.Threading.Tasks;
1112

@@ -40,6 +41,11 @@ public abstract class RoutineInfo : IPhpCallable, ICloneable
4041
/// </summary>
4142
public abstract PhpCallable PhpCallable { get; }
4243

44+
/// <summary>
45+
/// Invokes the routine.
46+
/// </summary>
47+
public virtual PhpValue Invoke(Context ctx, object? target, PhpValue p0) => Invoke(ctx, target, MemoryMarshal.CreateReadOnlySpan(ref p0, 1));
48+
4349
/// <summary>
4450
/// Invokes the routine.
4551
/// </summary>

0 commit comments

Comments
 (0)