User Changes 3.0.4

From Lazarus wiki
Jump to navigationJump to search

About this page

Listed below are intentional changes made to the FPC compiler (3.0.4) since the previous release that may break existing code. The list includes reasons why these changes have been implemented, and suggestions for how you might adapt your code if you find that previously working code has been adversely affected by these recent changes.

The list of new features that do not break existing code can be found here.

Please add revision numbers to the entries from now on. This facilitates moving merged items to the user changes of a release.

All systems

Implementation Changes

Unit changes

SysUtils

TList auto-growth
  • Old behaviour: Lists with number of elements greater than 127 was expanded by 1/4 of its current capacity
  • New behaviour: Adds two new thresholds. If number of elements is greater than 128 MB then list is expanded by constant amount of 16 MB elements (corresponds to 1/8 of 128 MB). If number of elements is greater then 8 MB then list is expanded by 1/8 of its current capacity.
  • Reason for change: Avoid out-of-memory when very large lists are expanded

Inifiles

  • Old behaviour: In 3.0.2, TMemIniFile.ReadSectionValues did not read invalid name/value pairs
  • New behaviour: 3.0.4 reads invalid name/value pairs again.
  • Reason for change: Wrong defaults assumptions in 3.0.2, change is more delphi and 3.0.0 compat
  • Remedy: If you only want real name/value pairs, pass an additional empty set parameter to ReadSectionValues. if you need invalid lines and comments please pass [svoIncludeComments,svoIncludeInvalid]

DB

TParam.LoadFromFile sets share mode to fmShareDenyWrite
  • Old behaviour: TFileStream.Create(FileName, fmOpenRead) was used, which has blocked subsequent access (also read-only) to same file
  • New behaviour: TFileStream.Create(FileName, fmOpenRead+fmShareDenyWrite) is used, which does not block read access to same file
  • Remedy: If your application requires exclusive access to file specify fmShareExclusive

i386-go32v2

Unit changes

go32

set_segment_base_address
  • Old behaviour: The second parameter, specifying the new segment base address was longint (signed 32-bit).
  • New behaviour: The second parameter was changed to dword (unsigned 32-bit).
  • Reason for change: Avoid range check errors for segment base addresses larger than 2GB.
set_descriptor_access_right
  • Old behaviour: The set_descriptor_access_right function returned a longint result, which wasn't well defined.
  • New behaviour: The set_descriptor_access_right function now returns a boolean result - TRUE if the function has been successful, FALSE if there was an error.
  • Reason: Bug fix. Previously, the set_descriptor_access_right function would return a longint, but only the low 16-bits were initialized (with 1 indicating success, 0 - failure).
  • Remedy: Instead of checking whether the result of set_descriptor_access_right is equal or different than 0, just use the boolean return value (TRUE indicates success).

Previous release notes