KUrl(QString) fix
Ralf Habacker
ralf.habacker at freenet.de
Sat Dec 30 10:41:19 GMT 2006
Aaron J. Seigo schrieb:
> On Friday 29 December 2006 16:13, Ralf Habacker wrote:
>
>> Which one is prefered ? Are there common rules for this ?
>>
>
> the problem with inlined methods in a library's public API is that you can't
> change them reliably.
>
> the code ends up copied into the binaries built against them (hence the term),
> so if you for some reason need to change the internal behaviour of that
> method .... you can't, really, because every binary built against that older
> version of the library will still be using the old, inlined code. so you need
> to uprade every app that uses that api to get the new behaviour. in a sense,
> it violates encapsulation and the methods are no longer "black boxes" free to
> change as needed.
>
> so unless there's some really good performance reason for inlining, it's
> probably best to seperate the implementation from the declaration.
>
>
Okay, just for info: I've performed a little check inline functions .
The results are shown below.
subdir non empty non trivial
inline function[1] inline functions[2]
./dnssd 0 0
./doc 0 0
./includes 0 0
./interfaces 20 13
./kate 238 56
./kcert 1 0
./kcmshell 0 0
./kconf_update 0 0
./kde3support 43 13
./kdecore 197 79
./kded 12 7
./kdefx 3 0
./kdeprint 16 1
./kdesu 16 2
./kdeui 138 75
./kdewidgets 0 0
./kdoctools 0 0
./khtml 1679 308
./kimgio 6 3
./kinit 4 0
./kio 290 69
./kioslave 22 0
./kjs 235 95
./kjsembed 75 1
./knewstuff 4 0
./knotify 8 2
./kparts 23 4
./kross 31 13
./kstyles 5 1
./kutils 0 0
./kwallet 7 2
./kxmlcore 134 97
./licenses 0 0
./mimetypes 0 0
./phonon 12 8
./pics 0 0
./solid 14 0
./sonnet 5 2
./test 0 0
./threadweaver 4 2
[1] inline functions including at least one statement
for i in ` find -mindepth 1 -maxdepth 1 -type d`; do echo -en "$i\t";
find $i -name '*.h' -exec gawk '$1 == "class" { class=$0} $0 ~/[
\ta-zA-Z0-9_]+\(.*\)[ a-zA-Z0-9]+\{.*;.*\}/ { print FILENAME "= " class
" - " $0 }' {} \; | wc -l ; done
[2] inline functions which contains at least one function call
for i in ` find -mindepth 1 -maxdepth 1 -type d`; do echo -en "$i\t";
find $i -name '*.h' -exec gawk '$1 == "class" { class=$0} $0 ~/[
\ta-zA-Z0-9_]+\(.*\)[ a-zA-Z0-9]+\{.*\(.*\).*;.*\}/ { print FILENAME "=
" class " - " $0 }' {} \; | wc -l ;
done
=$0} $0 ~/[ \ta-zA-Z0-9_]+\(.*\)[ a-zA-Z0-9]+\{.*\(.*\).*;.*\}/ { print
FILENAME "= " class " - " $0 }' {} \; | wc -l ; done
Ralf
More information about the kde-core-devel
mailing list