MCPcopy Create free account
hub / github.com/MariaDB/server / FileView

Method FileView

storage/connect/xindex.cpp:2494–2511  ·  view source on GitHub ↗

/ Map the entire index file. */ /

Source from the content-addressed store, hash-verified

2492 /* Map the entire index file. */
2493 /*********************************************************************/
2494void *XFILE::FileView(PGLOBAL g, char *fn)
2495 {
2496 HANDLE h;
2497
2498 Mmp = (MMP)PlugSubAlloc(g, NULL, sizeof(MEMMAP));
2499 h = CreateFileMap(g, fn, Mmp, MODE_READ, false);
2500
2501 if (h == INVALID_HANDLE_VALUE || (!Mmp->lenH && !Mmp->lenL)) {
2502 if (!(*g->Message))
2503 strcpy(g->Message, MSG(FILE_MAP_ERR));
2504
2505 CloseFileHandle(h); // Not used anymore
2506 return NULL; // No saved values
2507 } // endif h
2508
2509 CloseFileHandle(h); // Not used anymore
2510 return Mmp->memory;
2511 } // end of FileView
2512#endif // XMAP
2513
2514/* -------------------------- XHUGE Class --------------------------- */

Callers 1

MapInitMethod · 0.80

Calls 3

PlugSubAllocFunction · 0.85
CreateFileMapFunction · 0.85
CloseFileHandleFunction · 0.85

Tested by

no test coverage detected