mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 10:03:03 +01:00
Misc
This commit is contained in:
parent
963828c2c6
commit
9178fc4100
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PROGRAM: Template to define a local vary stack variable.
|
||||
* MODULE: array.h
|
||||
* MODULE: VaryStr.h
|
||||
* DESCRIPTION: Both automatic and dynamic memory allocation is available.
|
||||
*
|
||||
* The contents of this file are subject to the Initial
|
||||
@ -32,9 +32,9 @@
|
||||
namespace Firebird {
|
||||
|
||||
template <size_t x>
|
||||
class VaryStr : public vary
|
||||
{
|
||||
char vary_tail [x - 1];
|
||||
class VaryStr : public vary
|
||||
{
|
||||
char vary_tail[x - 1];
|
||||
|
||||
public:
|
||||
VaryStr()
|
||||
@ -46,7 +46,7 @@ public:
|
||||
|
||||
template <size_t x>
|
||||
class DynamicVaryStr : public VaryStr<x>
|
||||
{
|
||||
{
|
||||
vary* buffer;
|
||||
|
||||
void clear()
|
||||
@ -55,7 +55,7 @@ class DynamicVaryStr : public VaryStr<x>
|
||||
}
|
||||
|
||||
public:
|
||||
DynamicVaryStr() : buffer(0) { }
|
||||
DynamicVaryStr() : buffer(NULL) { }
|
||||
|
||||
// It does not preserve string data! Not hard to do, but not required today. AP, 2009.
|
||||
vary* getBuffer(size_t len)
|
||||
@ -64,10 +64,12 @@ public:
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
clear();
|
||||
buffer = reinterpret_cast<vary*>(FB_NEW(*getDefaultMemoryPool()) char[len + sizeof(USHORT)]);
|
||||
buffer->vary_length = 0;
|
||||
buffer->vary_string[0] = 0;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@ -79,4 +81,4 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif //CLASSES_VARYSTR_H
|
||||
#endif // CLASSES_VARYSTR_H
|
||||
|
@ -554,7 +554,7 @@ evh* EventManager::acquire_shmem()
|
||||
m_header->evh_current_process = m_processOffset;
|
||||
|
||||
// hvlad: condition below never can be true and we change evh_length
|
||||
// after remapping only. Also code below looks not complete, compare
|
||||
// after remapping only. Also code below looks not complete, compare
|
||||
// it with remapping code in alloc_global
|
||||
/***
|
||||
if (m_header->evh_length > m_shmemData.sh_mem_length_mapped)
|
||||
@ -603,6 +603,7 @@ evh* EventManager::acquire_shmem()
|
||||
#endif
|
||||
}
|
||||
***/
|
||||
|
||||
return m_header;
|
||||
}
|
||||
|
||||
|
@ -3689,7 +3689,7 @@ static void set_error(thread_db* tdbb, const xcp_repeat* exception, jrd_nod* msg
|
||||
case xcp_xcp_code:
|
||||
// CVC: If we have the exception name, use it instead of the number.
|
||||
// Solves SF Bug #494981.
|
||||
MET_lookup_exception(tdbb, exception->xcp_code, name,
|
||||
MET_lookup_exception(tdbb, exception->xcp_code, name,
|
||||
temp.vary_string, sizeof(temp) - sizeof(USHORT));
|
||||
|
||||
if (message[0])
|
||||
|
@ -3088,10 +3088,10 @@ int ISC_mutex_init(struct mtx* mutex)
|
||||
|
||||
#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
|
||||
int protocolRc = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT);
|
||||
if (protocolRc && (protocolRc != ENOTSUP))
|
||||
if (protocolRc && (protocolRc != ENOTSUP))
|
||||
{
|
||||
iscLogStatus("Pthread Error", (Arg::Gds(isc_sys_request)
|
||||
<< "pthread_mutexattr_setprotocol" << Arg::Unix(protocolRc)).value());
|
||||
iscLogStatus("Pthread Error", (Arg::Gds(isc_sys_request) <<
|
||||
"pthread_mutexattr_setprotocol" << Arg::Unix(protocolRc)).value());
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_ROBUST_MUTEX
|
||||
|
Loading…
Reference in New Issue
Block a user