TObject casting best way

Hello,

I would know that is the proper way to retrieve argument of type TObject :
TObject(NativeUInt(GetInputArg(0)));
or
GetInputArgAsObject(0)

For example :

procedure TDataScripter._FreeAndNil(aMachine: TatVirtualMachine);
 var
  Param0: TObject;
begin
  with AMachine do
  begin
    Param0 := TObject(NativeUInt(GetInputArg(0)));
    System.SysUtils.FreeAndNil(Param0);
    SetInputArg(0,Param0);
  end;
end;
procedure TDataScripter._FreeAndNil(aMachine: TatVirtualMachine);
 var
  Param0: TObject;
begin
  with AMachine do
  begin
    Param0 := GetInputArgAsObject(0);
    System.SysUtils.FreeAndNil(Param0);
    SetInputArg(0,Param0);
  end;
end;

Does GetInputArgAsObject is better to use ?

They do similar things, but GetInputArgAsObject is higher level and is forward compatible. I prefer to use it.