revert tests

This commit is contained in:
Christien Rioux 2015-12-12 22:03:16 -08:00
parent 0d527771eb
commit a9525d4682

View File

@ -229,13 +229,10 @@ unsigned int CLineCount::countThread(int thread_number)
tlc_linecount_t count = 0; tlc_linecount_t count = 0;
void *mem = NULL; void *mem = NULL;
void *mapmem = MMAP(NULL, m_filesize, PROT_READ, MAP_FILE | MAP_SHARED, m_fh, 0);
madvise(mapmem, m_filesize, MADV_SEQUENTIAL);
while (curoffset < m_filesize) while (curoffset < m_filesize)
{ {
if (m_thread_fail) if (m_thread_fail)
{ {
return -1; return -1;
} }
@ -244,6 +241,7 @@ madvise(mapmem, m_filesize, MADV_SEQUENTIAL);
// Map view of file // Map view of file
#ifdef _WIN32 #ifdef _WIN32
if (mem) if (mem)
{ {
if (!UnmapViewOfFile(mem)) if (!UnmapViewOfFile(mem))
@ -255,7 +253,7 @@ madvise(mapmem, m_filesize, MADV_SEQUENTIAL);
} }
mem = MapViewOfFile(m_filemapping, FILE_MAP_READ, (DWORD)(curoffset >> 32), (DWORD)curoffset, (SIZE_T)mapsize); mem = MapViewOfFile(m_filemapping, FILE_MAP_READ, (DWORD)(curoffset >> 32), (DWORD)curoffset, (SIZE_T)mapsize);
#else #else
/* if (mem) if (mem)
{ {
if(munmap(mem, lastmapsize) !=0) if(munmap(mem, lastmapsize) !=0)
{ {
@ -265,7 +263,6 @@ madvise(mapmem, m_filesize, MADV_SEQUENTIAL);
} }
} }
mem = MMAP(NULL, mapsize, PROT_READ, MAP_FILE | MAP_SHARED, m_fh, curoffset); */ mem = MMAP(NULL, mapsize, PROT_READ, MAP_FILE | MAP_SHARED, m_fh, curoffset); */
mem = ((char *)mapmem) + curoffset;
// printf("%p %lld %lld\n",mem, mapsize, curoffset); // printf("%p %lld %lld\n",mem, mapsize, curoffset);
#endif #endif
if (mem == MAP_FAILED) if (mem == MAP_FAILED)