Date: Tue, 29 Apr 2025 17:24:22 -0700
On Tuesday, 29 April 2025 11:54:19 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> Not related to the standardisation of C++, but another trick is to keep
> track of which pages of memory are read-only, and to not bother copying the
> string if it's in read-only memory. Of course this will only work properly
> if your program doesn't change the permissions on pages of memory.
Which includes unloading plugins.
We did provide the QStringLiteral macro in Qt 4 so that it would create a
QString that didn't allocate memory, but found that libraries stored strings
created from plugins, which got unloaded.
We eventually solved that by banning unloading. And since use of inline
variables causes plugins not to be unloadable anyway, this problem has become
moot.
Linux doesn't make it easy to query a page's permissions; there's no
VirtualQuery like Windows. On other Unix OSes, I don't even know if there is
any way to get the information.
Gotham via Std-Proposals wrote:
> Not related to the standardisation of C++, but another trick is to keep
> track of which pages of memory are read-only, and to not bother copying the
> string if it's in read-only memory. Of course this will only work properly
> if your program doesn't change the permissions on pages of memory.
Which includes unloading plugins.
We did provide the QStringLiteral macro in Qt 4 so that it would create a
QString that didn't allocate memory, but found that libraries stored strings
created from plugins, which got unloaded.
We eventually solved that by banning unloading. And since use of inline
variables causes plugins not to be unloadable anyway, this problem has become
moot.
Linux doesn't make it easy to query a page's permissions; there's no
VirtualQuery like Windows. On other Unix OSes, I don't even know if there is
any way to get the information.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering
Received on 2025-04-30 00:24:24