|author||Cedric Bail <email@example.com>||2013-10-28 18:28:38 +0900|
|committer||Cedric Bail <firstname.lastname@example.org>||2013-10-28 18:32:40 +0900|
eet: help the kernel to actually load the eet file in memory more efficiently.
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.
Diffstat (limited to 'src/lib/eet/eet_lib.c')
1 files changed, 10 insertions, 0 deletions
|@@ -1043,6 +1043,16 @@ eet_internal_read2(Eet_File *ef)|
|1043||#endif /* ifdef HAVE_SIGNATURE */||1043||#endif /* ifdef HAVE_SIGNATURE */|
|1046||/* At this stage we have a valid eet file, let's tell the system we are likely to need most of its data */|
|1047||if (ef->readfp && ef->ed)|
|1049||unsigned long int offset;|
|1051||offset = (unsigned char*) ef->ed->start - (unsigned char*) ef->data;|
|1052||eina_file_map_populate(ef->readfp, EINA_FILE_WILLNEED, ef->data,|
|1053||offset, ef->data_size - offset);|
|1046||return ef;||1056||return ef;|