Re: Moving the struct instance heap space to mmap



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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]