System.TMarshal.FixString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function FixString(var Str: string): TPtrWrapper; overload;

Properties

Type Visibility Source Unit Parent
function public System.pas System TMarshal

Description

Returns a wrapped pointer referencing the data at the start of the string.

The FixString method ensures the string has its reference count incremented. The returned value should be passed to UnfixString when finished with to avoid memory leaks.

The Str string is made unique before returning the pointer, to avoid accidental corruption of shared strings.

See Also