#842 #include <sys/mman.h> is moved from public headers closer to usage

This commit is contained in:
Andrey Kamaev 2012-03-27 21:29:58 +00:00
parent 3ac1f31126
commit 8eb788c6e7
2 changed files with 12 additions and 10 deletions

View File

@ -69,7 +69,6 @@
#undef max #undef max
#else #else
#include <pthread.h> #include <pthread.h>
#include <sys/mman.h>
#endif #endif
#ifdef __BORLANDC__ #ifdef __BORLANDC__

View File

@ -78,7 +78,7 @@ void fastFree(void* ptr)
} }
} }
#else #else //CV_USE_SYSTEM_MALLOC
#if 0 #if 0
#define SANITY_CHECK(block) \ #define SANITY_CHECK(block) \
@ -113,7 +113,10 @@ void SystemFree(void* ptr, size_t)
{ {
free(ptr); free(ptr);
} }
#else #else //WIN32
#include <sys/mman.h>
struct CriticalSection struct CriticalSection
{ {
CriticalSection() { pthread_mutex_init(&mutex, 0); } CriticalSection() { pthread_mutex_init(&mutex, 0); }
@ -139,7 +142,7 @@ void SystemFree(void* ptr, size_t size)
{ {
munmap(ptr, size); munmap(ptr, size);
} }
#endif #endif //WIN32
struct AutoLock struct AutoLock
{ {
@ -386,7 +389,7 @@ struct ThreadData
#ifdef WIN32 #ifdef WIN32
#ifdef WINCE #ifdef WINCE
# define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF) # define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
#endif #endif //WINCE
static DWORD tlsKey; static DWORD tlsKey;
static ThreadData* get() static ThreadData* get()
@ -402,7 +405,7 @@ struct ThreadData
} }
return data; return data;
} }
#else #else //WIN32
static void deleteData(void* data) static void deleteData(void* data)
{ {
delete (ThreadData*)data; delete (ThreadData*)data;
@ -422,7 +425,7 @@ struct ThreadData
} }
return data; return data;
} }
#endif #endif //WIN32
}; };
#ifdef WIN32 #ifdef WIN32
@ -434,9 +437,9 @@ void deleteThreadAllocData()
delete (ThreadData*)TlsGetValue( ThreadData::tlsKey ); delete (ThreadData*)TlsGetValue( ThreadData::tlsKey );
} }
#else #else //WIN32
pthread_key_t ThreadData::tlsKey = 0; pthread_key_t ThreadData::tlsKey = 0;
#endif #endif //WIN32
#if 0 #if 0
static void checkList(ThreadData* tls, int idx) static void checkList(ThreadData* tls, int idx)
@ -674,7 +677,7 @@ void fastFree( void* ptr )
} }
} }
#endif #endif //CV_USE_SYSTEM_MALLOC
} }