-
Content Count
1365 -
Joined
-
Last visited
-
Days Won
130
Posts posted by Stefan Glienke
-
-
Using 10.4 you can do this with the following code:
TArray.Sort<yourtype>(list.PList^, list.Comparer, index, count);
- 1
-
14 hours ago, Anders Melander said:-
The filter problem turned out to be a copy/paste problem.
Allen had copied his map2pdb parameter list from a post here, and somewhere along the way, two invisible zero-width no-break space characters (#$F0FF) got inserted into the string he pasted. So what looked like '-include:0001' was actually '-include:000'#$F0FF#$F0FF'1'.
I've been bitten by that one myself a few times when I've copied code from a browser.
I reported that issue years ago but unfortunately it still exists - the report contains the exact steps that lead to this at the end and thus might help to avoid it in the future:
- 1
-
The filter problem turned out to be a copy/paste problem.
-
No, but it should be pretty simple to sort the ItemGroup node in the groupproj file according to your needs.
-
fwiw all parameters but passing the mapfile name (since the exe name is most likely the same and directly next to it) and the -bind parameter (which causes the PE header in the binary to be updated in order for VTune to properly use the pdb) are optional.
3 hours ago, chkaufmann said:Where can I find a good tutorial for VTune in order to get the info I used before with AQTime?
VTune has some very extensive documentation and even a tour inside the application that teaches the basics
-
Putting the line number to the left into a gutter just like in the editor would save a lot of vertical space - take a look at the Notepad++ search results window
- 1
- 1
-
Not so fast - it more likely was some AI that learned it from those sources - soon all loops will be written that way!
5 minutes ago, dummzeuch said:So, why is that a problem? Is the code wrong? Or is it just not the way you would have written it?
The problem is that apparently whoever implemented it that way in the VCL did not even care to apply their style guide to the code.
And I am not even going into the legal ramifications of Embarcadero copying code from the internet and then putting it under their copyright.
- 1
-
Anyone serious about implementing any data structures that require heap allocation should consider some sort of suballocation pattern to avoid or mitigate memory fragmentation.
Also, there is a reason why things like rebuilding indexes exist in databases.
- 1
-
No, RTTI does not contain any flag for a method being overloaded which makes it impossible to do proper overload resolution using RTTI because you cannot determine if a method would be "visible" or not.
-
4 hours ago, FabDev said:Yes my project (> 8 millions of line code) use not far than 40 components libraries like Devexpress (90 % of them component), TMS VCL, IBDAC, Fastreport, Teechart, HTMLEditor, Scalabium, JEDI, Indy, ICS, ImageEN, Jam Software, HTML Editor etc... All components are always up to date to "limit" bug.
PS : I can have same kind of memory using when press F1 on a word.
Could it be that you have some active database connection and live data? That contributes to the memory consumption of the bds.exe process.
Edit: Also FWIW the memory shown in the TaskManager is the memory consumed for that process and all its sub-processes - click the expand button and you will see. I assume that there will be several LSP Server processes consuming quite some memory.
-
A multiline string is multiline - simple as that.
- 1
- 2
-
2 hours ago, Anders Melander said:how does one differentiate between preserve or trim leading white space and preserve or ignore newline?
The closing quotes dictate the alignment, lines inside the string thus cannot be more left than the closing quotes, the last line does not have a trailing line break, if you want a trailing line break, add an empty line
- 1
- 1
-
Why exactly? data is the PByte parameter that comes into that function and if ultimately not nil it gets passed to ConstructAttributes
-
People like Gor would call the majority of the Delphi RTL and alike "not an appropriate solution for writing scalable concurrent software" so we have to be a bit reasonable when putting this statement into context.
- 1
-
On 9/1/2023 at 3:53 PM, Sherlock said:they (MS)
Given that PowerToys is on GitHub, I would say that "they" is the community and not only MS - see "Support ARM platform"
-
1 hour ago, Fr0sT.Brutal said:Yeah, nice, they did it right. I think every lib dev should do the same, and probably shrink some older packages like f.i. "XE2-XE8"
As one of the few lib devs that actually test their code on all supported Delphi versions I object - dproj files so often have incompatibilities in them.
Yes, it is possible to have only multiple dproj files but only one dpk they refer to and put the libsuffix stuff into an inc file referencing that one on the dpr (have done that, works fine) but it is tedious.
I rather copy the latest version when a new one comes out/is in beta.
The more important thing imo is using forward-compatible defines in the code - it drives me mad whenever I compile some code in a newer version and it simply does not work because the code requires explicit defines because they are not done in a forward-compatible way.
- 6
-
26 minutes ago, Uwe Raabe said:Could it be that using the equality operator qualifies for calling any method?
If you are referring to TGUID specifically then I would assume that to be the case as that is basically what happens because it has operator overloading.
To be more precise though because my previous comment might be misleading:
- currently, we don't get any W1036 on using a field on some local record variable (see Test4)
- we get a W1036 on local intrinsic non-managed type variables such as Integer (see Test1)
- we *don't* get a W1036 on local intrinsic non-managed type variables such as Integer when they get passed by ref (see Test2) or a helper method is being called on them (see Test3) anywhere in the routine.
type TIntHelper = record helper for Integer procedure Foo; end; procedure TIntHelper.Foo; begin end; procedure PassRef(var ref); begin end; procedure Test1; var i: Integer; begin if i = 0 then Writeln; end; procedure Test2; var i: Integer; begin if i = 0 then Writeln; PassRef(i); end; procedure Test3; var i: Integer; begin if i = 0 then Writeln; i.Foo; end; procedure Test4; var g: TGUID; begin if g.D1 = 0 then Writeln; end; end.
My point is - yes I can craft some version of Test4 where something might happen with g that causes it to be initialized or not - but the point is: if I access any field on it *before* that it is a hundred percent certain that I am accessing an uninitialized field.
Now in practice the compiler source code and its design might be in a state where doing this is hard to achieve but the point is: it's not impossible.
-
We already have the situation that calling any method on a record disables the warning - I did not mention disabling that behavior, did I?
Also, don't you think a compiler could easily see if the access to a field happens before or after some method call?
I explicitly stated that there would still be cases where a W1036 would be appropriate but would not be seen due to some reasons but in the places where it is hundred percent certain that the access is to an uninitialized field the compiler should raise it
- 1
-
The explanation was given by the pm and not some compiler dev fwiw and it is nonsense tbh.
The compiler already knows if a record is managed or not because if its managed then it inserts code to call to System._InitializeRecord.
Now the case can happen that you access some field on a record that is a managed record but that field is of a non managed type - these fields are not touched inside that routine.
The compiler can still issue a W1036 when accessing a field on a record that is not managed - would there still be cases where a warning would be missing? Yes, but it would be better than it is currently.
- 2
-
Coroutines are not a dead end at all - in fact, there are more and more languages making them first-class citizens because you can write asynchronous code just like you would write sequentially.
Google for "project loom" for example.
-
https://bitbucket.org/sglienke/spring4d/branch/feature/coroutines - the reasons it never made it into the main branch are what has been mentioned before and the fact that on POSIX I emulate them using a thread and an event (which is deadly slow) - still until anyone convinces me otherwise (by showing some actual working code!) this is the closest we get to some conveniently usable coroutines in Delphi.
- 1
-
How would changing the variable from ColorRef to TColor help? That will only change the location of the warning because RGB returns ColorRef (given this is the function from Winapi.Windows.pas).
-
I am not sure what y'all discussing here but the snippet that Tommi posted is about checking the first character before even calling strncmp (video at around 15:15).
It's pretty obvious why that is faster - if the characters don't match you get rid of the function call.
The algo does not need to restrict anything - the hashtable contains all keywords and the input is any string that occurs in the source code - if it's a keyword, it gets found, if it's not, then it won't be found, simple as that.
- 2
-
On 32bit the compiler keeps the value of the multiplication in the FPU to pass it to Round (which takes its parameter as Extended), on 64bit the precision of Extended is the same as Double.
You get the same result on 32bit if you store the result of the multiplication into a double variable and then pass that one to round.
- 2
-
16 minutes ago, Cristian Peța said:It is because calling convention Right-to-left parameter order?
No, because there are no parameters on ReadChar.
No, because even if you mean the string concat method (which is UStrCat3 that will be called here) you will see that if you call ReadChar a third time suddenly order is correct (which then calls UStrCatN)
No, because even parameter passing order is undefined behavior in Delphi
- 1
Intel Simd-sort library
in Algorithms, Data Structures and Class Design
Posted
A serious question because many sort benchmarks are so obsessed with sorting large arrays/vectors of just integers and floats:
Do people in reality really have these kinds of data that need to be sorted?