Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-06

Lazarus instability on windows caused by widestrings?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

I am investigating some instabilities of lazarus and stumbled on the following (from UTF8Decode).

var
   hs: widestring;
begin
   SetLength(hs,20);
   SetLength(hs,8);
end;

In fpc_WideStr_SetLength first a string is allocated with NewWideString, which calls SysAllocStringLen on windows.

For the second SetLength, a plain reallocmem is used, where I would have expected a call to SysReAllocStringLen.

What do you think?

Vincent.

Reply by email

Florian Klaempfl
to Vincent Snijders
Vincent Snijders wrote 19 lines
Hi, I am investigating some instabilities of lazarus and stumbled on the following (from UTF8Decode). var hs: widestring; begin SetLength(hs,20); SetLength(hs,8); end; In fpc_WideStr_SetLength first a string is allocated with NewWideString, which calls SysAllocStringLen on windows. For the second SetLength, a plain reallocmem is used, where I would have expected a call to SysReAllocStringLen. What do you think?

This was forgotten to change :( Sending a patch is ok ;)

Reply by email

Vincent Snijders
to Florian Klaempfl
Florian Klaempfl wrote 25 lines
Vincent Snijders wrote: >Hi, > >I am investigating some instabilities of lazarus and stumbled on the >following (from UTF8Decode). > >var > hs: widestring; >begin > SetLength(hs,20); > SetLength(hs,8); >end; > >In fpc_WideStr_SetLength first a string is allocated with NewWideString, >which calls SysAllocStringLen on windows. > >For the second SetLength, a plain reallocmem is used, where I would have >expected a call to SysReAllocStringLen. > >What do you think? This was forgotten to change :( Sending a patch is ok ;)

Don't expect a patch from me. I think this is too low level RTL, otherwise I would have tried it out myself to be sure. Using fpc 2.0.0 for lazarus on win32 is another option, I guess.

Should I make a bug report for it?

Vincent.

Reply by email