MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLGetFindFileTLS

Function CPLGetFindFileTLS

port/cpl_findfile.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56/************************************************************************/
57
58static FindFileTLS *CPLGetFindFileTLS()
59{
60 int bMemoryError = FALSE;
61 FindFileTLS *pTLSData = reinterpret_cast<FindFileTLS *>(
62 CPLGetTLSEx(CTLS_FINDFILE, &bMemoryError));
63 if (bMemoryError)
64 return nullptr;
65 if (pTLSData == nullptr)
66 {
67 pTLSData = static_cast<FindFileTLS *>(
68 VSI_CALLOC_VERBOSE(1, sizeof(FindFileTLS)));
69 if (pTLSData == nullptr)
70 return nullptr;
71 CPLSetTLSWithFreeFunc(CTLS_FINDFILE, pTLSData, CPLFindFileFreeTLS);
72 }
73 return pTLSData;
74}
75
76/************************************************************************/
77/* CPLFinderInit() */

Callers 3

CPLFinderInitFunction · 0.85
CPLFinderCleanFunction · 0.85
CPLDefaultFindFileFunction · 0.85

Calls 2

CPLGetTLSExFunction · 0.85
CPLSetTLSWithFreeFuncFunction · 0.85

Tested by

no test coverage detected