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

Method ensureSpace

src/jrd/Monitoring.cpp:369–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367
368
369void MonitoringData::ensureSpace(ULONG length)
370{
371 FB_UINT64 newSize = m_sharedMemory->getHeader()->used + length;
372
373 if (newSize > m_sharedMemory->getHeader()->allocated)
374 {
375 if (newSize > MAX_ULONG)
376 {
377 (Arg::Gds(isc_montabexh) <<
378 Arg::Gds(isc_random) << Arg::Str("storage size exceeds limit")).raise();
379 }
380
381 FB_UINT64 remapSize = FB_ALIGN(newSize, DEFAULT_SIZE);
382 if (remapSize > MAX_ULONG)
383 remapSize = newSize;
384
385#ifdef HAVE_OBJECT_MAP
386 FbLocalStatus statusVector;
387 if (!m_sharedMemory->remapFile(&statusVector, (ULONG) remapSize, true))
388 {
389 status_exception::raise(&statusVector);
390 }
391 m_sharedMemory->getHeader()->allocated = m_sharedMemory->sh_mem_length_mapped;
392#else
393 status_exception::raise(Arg::Gds(isc_montabexh));
394#endif
395 }
396}
397
398
399void MonitoringData::mutexBug(int osErrorCode, const char* s)

Callers

nothing calls this directly

Calls 7

GdsClass · 0.85
StrClass · 0.85
FB_ALIGNFunction · 0.85
raiseFunction · 0.85
remapFileMethod · 0.80
getHeaderMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected