2006/6/8, Marc Weustink <[EMAIL PROTECTED]>:
I think, this is not really a memory leak, but more likely memory
fragmentation, since you are allocating random lengths. However I don't
know if SetLength reduces the mem when the length of an array is
shortened. It might be that you are working with
Alexandre Leclerc wrote:
2006/6/7, Alexandre Leclerc <[EMAIL PROTECTED]>:
I asked the question for a string array. I see that we can assign a
string directly to a pchar, but when I SetLength() such an array, do I
have to free the PChar string no more used or is it done
automatically?
var
a:
At Delphi, the runtime memory manager is supposed to handle the strings. Any
PChars are just pointers to those strings I think. When you use a Pchar as a
string, it must be getting some runtime string proxy that keeps that pchar
and has some size calculation function instead of pointing to some cla
2006/6/7, Alexandre Leclerc <[EMAIL PROTECTED]>:
I asked the question for a string array. I see that we can assign a
string directly to a pchar, but when I SetLength() such an array, do I
have to free the PChar string no more used or is it done
automatically?
var
a: array of PChar;
begin
Set
I asked the question for a string array. I see that we can assign a
string directly to a pchar, but when I SetLength() such an array, do I
have to free the PChar string no more used or is it done
automatically?
var
a: array of PChar;
begin
SetLength(a, 4);
a[0] := 'First pchar line';
a[1] :=