Are C++ vtables shared or private memory?
Are C++ vtables shared or private memory?
- Subject: Are C++ vtables shared or private memory?
- From: Jens Alfke <email@hidden>
- Date: Thu, 10 Sep 2009 13:36:28 -0700
I'm working on reducing the memory usage of a large C++ app (the
Chrome browser). Past experience has taught me that C++ vtables take
up a surprising amount of space, and they're private data (not shared
between processes, as code is.)
From poring over disassembly, I think I've established that GCC
mangles vtables as symbols starting with "__ZTV". There are definitely
a lot of symbols like this in the app, but 'nm -m' describes them all
as:
027b2b20 (__DATA,__const_coal) non-external (was a private external)
__ZTVN7WebCore16HTMLDListElementE
02772e80 (__DATA,__const) non-external (was a private external)
__ZTVN7WebCore16HTMLEmbedElementE
...
Does "__DATA,__const" mean that the vtables are actually in a read-
only section, so they just get mapped in as shared memory? (And if so,
how does that work? I thought vtables had to be fixed up at load time
since they're full of pointers to relocatable code.)
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden