12
votes
Vote UpVote

All hail the “const” parameters!

DelphiTools – Passing parameters as “const” is a classic Delphi optimization trick, but the mechanisms behind that “trick” go beyond cargo-cult recipes, and may actually stumble into the “good practice” territory. Why does it work? The most well known case is “const String“, for which the compiler than takes advantage of the “const” to pass the String reference directly (as a pointer)… and without increasing the reference counter. To illustrate what the reference counting implies, here are two screen-shots from the CPU disassembly view, taken ...
Favorite? Off-Topic? Eric @ 2010-07-28 08:16

Statistics

Visits: 1022
Votes: 12
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Cobus Kruger
Francis Ruiz
jamiei
Jan Derk
JC Chu
Jim McKeeth
Lars Fosdal
Mohammed Nasman
Rob McDonell
Sergio
vcldeveloper
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)