Generic surprises

Generic surprises

1. The generic type is constrained, but cannot be used for class references?

type

TBase = class

procedure NothingAbstractHere;

constructor Create; virtual;

end;

TGenericWrapper = class

type

TBaseClass = class of TB; <– [dcc32 Error]: E2021 Class type required

end;

Is there any logical reason for why this should not be possible?

2. Constructing an instance from a generic type does not flag construction of a class with unimplemented virtual abstract methods. This one I can understand, but it still is annoying. I guess I could factory functions to work around it.

This piece of code is Windows only:

This piece of code is Windows only:

function MemoryUsed: cardinal; inline;

var

MMS: TMemoryManagerState;

Block: TSmallBlockTypeState;

begin

GetMemoryManagerState(MMS);

Result := MMS.TotalAllocatedMediumBlockSize + MMS.TotalAllocatedLargeBlockSize;

for Block in MMS.SmallBlockTypeStates

do Result := Result + (Block.UseableBlockSize * Block.AllocatedBlockCount);

end;

Is there something that is available on other platforms (POSIX) that can give me an idea of how much memory the app is using, without calling native OS functions?

More than I dislike misleading marketing, I dislike not knowing if we will ever get native support for 64-bit…

More than I dislike misleading marketing, I dislike not knowing if we will ever get native support for 64-bit Windows on ARM in Delphi.

https://mspoweruser.com/qualcomm-announces-snapdragon-850-mobile-processor-for-always-connected-windows-10-pcs/

Optimal Synchronous Concurrency

Optimal Synchronous Concurrency

What are the odds that two books from the same author, ordered from different sites, on different dates – both arrive at my door within 30 seconds, with two different methods of delivery?

My son picked up the Delphi High Performance book from Packt.com in our mailbox, walked in to my office and dropped it off, and seconds later – there is a UPS delivery guy ringing my doorbell, carrying the OTL book from Lulu.com:)

Looking forward to delving in deep, now.

What decides where GetIt places the stuff it installs?

What decides where GetIt places the stuff it installs?

It seems that the files are placed under current user, even if Delphi is installed for “all users”. How do you get around that for a build server where the build process is running under a system account? This is kinda ridiculous.

Quote from Vincent Parrett: “Umm.. don’t use getit.. its a toy not a real package manager. Seriously why tf would it place libraries under the user profile.”

I have to agree. GetIt appears like a really trivial download/installer, than an actual package installer.

I guess it would be better to install the libs locally, then copy them to VCS managed folders, and check out those on the build server.

Originally shared by Lars Fosdal

GetIt, FinalBuilder and Continua Build Server

We are having some issues with the OmniThreadLibrary not being found when FinalBuilder is invoked from Continua.

GetIt places OTL under

C:UsersDocumentsEmbarcaderoStudio19.0CatalogRepositoryOmniThreadLibrary_3.07.4-Tokyo

and when I am logged on to the server, the FB projects build fine. When the Continua service user executes, it is a different user than my UI login – so naturally, the installation is not there.

What is the recommended way to get around this?