procedure _UStrArrayClr(var StrArray; Count: Integer);
{$IF not defined(CPU386)}
var
P: Pointer;
begin
P := @StrArray;
while Count > 0 do
begin
_UStrClr(P^);
Dec(Count);
Inc(NativeInt(P), SizeOf(Pointer));
end;
end;
{$ELSE}
asm
{ -> EAX pointer to str }
{ EDX cnt }
{$IFDEF ALIGN_STACK}
SUB ESP,4
{$ENDIF ALIGN_STACK}
PUSH EBX
PUSH ESI
MOV EBX,EAX
MOV ESI,EDX
@@loop:
MOV EDX,[EBX] { fetch str }
TEST EDX,EDX { if nil, nothing to do }
JE @@doneEntry
MOV dword ptr [EBX],0 { clear str }
MOV ECX,[EDX-skew].StrRec.refCnt { fetch refCnt }
DEC ECX { if < 0: literal str }
JL @@doneEntry
LOCK
DEC [EDX-skew].StrRec.refCnt { threadsafe
dec refCount }
JNE @@doneEntry
LEA EAX,[EDX-skew] { if refCnt now zero, deallocate}
CALL _FreeMem
@@doneEntry:
ADD EBX,4
DEC ESI
JNE @@loop
POP ESI
POP EBX
{$IFDEF ALIGN_STACK}
ADD ESP,4
{$ENDIF ALIGN_STACK}
end;
{$IFEND}