| 367 | |
| 368 | |
| 369 | void 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 | |
| 399 | void MonitoringData::mutexBug(int osErrorCode, const char* s) |