MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / init_shared_file

Method init_shared_file

src/lock/lock.cpp:310–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308
309
310bool LockManager::init_shared_file(CheckStatusWrapper* statusVector)
311{
312 PathName name;
313 get_shared_file_name(name);
314
315 try
316 {
317 SharedMemory<lhb>* tmp = FB_NEW_POOL(getPool()) SharedMemory<lhb>(name.c_str(), m_memorySize, this);
318 // initialize will reset m_sharedMemory
319 fb_assert(m_sharedMemory == tmp);
320
321 const auto header = tmp->getHeader();
322 checkHeader(header);
323
324 // Get properly aligned value
325 m_memorySize = m_sharedMemory->sh_mem_increment;
326 }
327 catch (const Exception& ex)
328 {
329 ex.stuffException(statusVector);
330 return false;
331 }
332
333#ifdef USE_SHMEM_EXT
334 m_extents[0] = *this;
335#endif
336
337 return true;
338}
339
340
341void LockManager::get_shared_file_name(PathName& name, ULONG extent) const

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.45
getHeaderMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected