Registriert seit: 12. Jun 2002
3.483 Beiträge
Delphi 10.1 Berlin Professional
|
Re: SetLength(dyn. array, 0) vs. Finalize() vs. nil
7. Nov 2005, 00:02
Ja.
Delphi-Quellcode:
function New(Size: Longint; TypeInfo: Pointer): Pointer;
begin
GetMem(Result, Size);
if Result <> nil then
Initialize(Result, TypeInfo);
end;
procedure Dispose(P: Pointer; TypeInfo: Pointer);
begin
Finalize(P, TypeInfo);
FreeMem(P);
end;
|