operator new no longer routes through rtl_AllocMemory in libsalcpprt under gbuild link rules
Stephan Bergmann
sbergman at redhat.com
Fri May 18 07:23:11 PDT 2012
On 05/18/2012 03:38 PM, Arnaud Versini wrote:
> I checked on Linux and Windows, the memory after a massive allocation
> and a massive deallocation is really freed, so currently la raison
> d'être of our internal allocator is gone (need to be checked on Mac Os
> X). About performance I don't know.
Indeed, on Fedora 16 at least,
$ cat test.cc
#include <iostream>
#include <string>
int main() {
char * p[100000];
for (int i = 0; i != 100000; ++i) p[i] = new char[10000];
std::cout << "...";
std::cin.ignore();
for (int i = 0; i != 100000; ++i) delete p[i];
std::cout << "...";
std::cin.ignore();
}
$ g++ test.cc
$ ./a.out
and "pmap ... | grep total" at the two checkpoints reveals a
shrink-again allocation mechanism (from 990752K back to 12736K here).
Stephan
More information about the LibreOffice
mailing list