When you open a theme, it is very likely that most of the data in it will be needed
at some point, that's why it is a good idea to tell it in advance to the kernel so
it could load them if it has some spare ressource.
We can't just blindly turn EINA_FILE_WILLNEED on any file or a wrong eet file would
be loaded in memory when we don't need it. So we shall keep the sequential load until
we are sure that the file is correct and then explicitely tell the kernel that the
rest of the data should be loaded in ram.
#endif /* ifdef HAVE_SIGNATURE */
}
+ /* At this stage we have a valid eet file, let's tell the system we are likely to need most of its data */
+ if (ef->readfp && ef->ed)
+ {
+ unsigned long int offset;
+
+ offset = (unsigned char*) ef->ed->start - (unsigned char*) ef->data;
+ eina_file_map_populate(ef->readfp, EINA_FILE_WILLNEED, ef->data,
+ offset, ef->data_size - offset);
+ }
+
return ef;
}