lib/xmltree/xmlinterface.cpp: use posix_fadvise to try reduce cached pages, while loading huge epg data

This commit is contained in:
[CST] Focus
2014-07-23 13:15:55 +04:00
parent 94e6cf9a25
commit f15e5eeb39

View File

@@ -42,7 +42,8 @@
#else /* USE_LIBXML */
#include "xmltok.h"
#endif /* USE_LIBXML */
#include <fcntl.h>
#include <stdio.h>
unsigned long xmlGetNumericAttribute(const xmlNodePtr node, const char *name, const int base)
{
@@ -239,6 +240,9 @@ xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence /* =
}
while (!done);
if (posix_fadvise(fileno(xml_file), 0, 0, POSIX_FADV_DONTNEED) != 0)
perror("posix_fadvise FAILED!");
fclose(xml_file);
if (!tree_parser->RootNode())