Re: Moving the struct instance heap space to mmap

Eero Tamminen <[email protected]>
Newsgroups gmane.comp.gnome.performance,gmane.comp.gnome.evolution.devel
Message-ID <[email protected]>
Hi,

ext Federico Mena Quintero wrote:
> gpointer
> gimme_ptr_to_subject_for_message_number (int n)
> {
>    return pointers_to_message_summaries[n] + SUBJECT_OFFSET;
> }

Functions that do nothing else besides single array or struct lookup
are hopefully static inlines in some header, so that the binary is
not bloated with:
- unnecessary global function resolving (both performance & memory
   issue as can be read from Depper's ldso paper)
- code for pushing and popping the args to/from stack

(I'm not sure about x86, but if I remember correctly on 86k the inline
version of this function would have been just one asm instruction...)


The matter is a bit more tricky if one would want to export this API
from a shared library, as then details about the library internal
structures (offsets, array names etc) would be compiled into binaries
using the library.  This could be handled with library versioning,
but one needs to be more careful with changes and updates will require
more often rebuild of the dependent applications.


	- Eero
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.