mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Some missing from merge.
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
ec939a5bce
commit
f4be15a7af
1895 changed files with 160408 additions and 53601 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// $Id: Shared_Memory_Pool.cpp 97185 2013-05-30 18:51:35Z johnnyw $
|
||||
|
||||
// Shared_Memory_Pool.cpp
|
||||
#include "ace/Shared_Memory_Pool.h"
|
||||
#include "ace/OS_NS_sys_shm.h"
|
||||
|
|
@ -38,11 +40,6 @@ int
|
|||
ACE_Shared_Memory_Pool::in_use (ACE_OFF_T &offset,
|
||||
size_t &counter)
|
||||
{
|
||||
#ifndef ACE_HAS_SYSV_IPC
|
||||
ACE_UNUSED_ARG (offset);
|
||||
ACE_UNUSED_ARG (counter);
|
||||
ACE_NOTSUP_RETURN (-1);
|
||||
#else
|
||||
offset = 0;
|
||||
SHM_TABLE *st = reinterpret_cast<SHM_TABLE *> (this->base_addr_);
|
||||
shmid_ds buf;
|
||||
|
|
@ -59,8 +56,8 @@ ACE_Shared_Memory_Pool::in_use (ACE_OFF_T &offset,
|
|||
offset += buf.shm_segsz;
|
||||
// ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset));
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -68,12 +65,6 @@ ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr,
|
|||
ACE_OFF_T &offset,
|
||||
size_t &counter)
|
||||
{
|
||||
#ifndef ACE_HAS_SYSV_IPC
|
||||
ACE_UNUSED_ARG (searchPtr);
|
||||
ACE_UNUSED_ARG (offset);
|
||||
ACE_UNUSED_ARG (counter);
|
||||
ACE_NOTSUP_RETURN (-1);
|
||||
#else
|
||||
offset = 0;
|
||||
SHM_TABLE *st = reinterpret_cast<SHM_TABLE *> (this->base_addr_);
|
||||
shmid_ds buf;
|
||||
|
|
@ -103,7 +94,6 @@ ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr,
|
|||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -123,7 +113,7 @@ ACE_Shared_Memory_Pool::commit_backing_store_name (size_t rounded_bytes,
|
|||
"exceeded max number of segments = %d, base = %u, offset = %u\n",
|
||||
counter,
|
||||
this->base_addr_,
|
||||
static_cast<unsigned int>(offset)),
|
||||
offset),
|
||||
-1);
|
||||
else
|
||||
{
|
||||
|
|
@ -244,22 +234,16 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool (
|
|||
this->segment_size_ = options->segment_size_;
|
||||
}
|
||||
|
||||
#ifndef ACE_HAS_SYSV_IPC
|
||||
ACE_UNUSED_ARG (backing_store_name);
|
||||
#else
|
||||
if (backing_store_name)
|
||||
{
|
||||
// Convert the string into a number that is used as the segment
|
||||
// key.
|
||||
|
||||
int segment_key = 0;
|
||||
#if !defined (ACE_LACKS_SSCANF)
|
||||
int segment_key;
|
||||
int result = ::sscanf (ACE_TEXT_ALWAYS_CHAR (backing_store_name),
|
||||
"%d",
|
||||
&segment_key);
|
||||
#else
|
||||
int result = 0;
|
||||
#endif /* ACE_LACKS_SSCANF */
|
||||
|
||||
if (result == 0 || result == EOF)
|
||||
// The conversion to a number failed so hash with crc32
|
||||
// ACE::crc32 is also used in <SV_Semaphore_Simple>.
|
||||
|
|
@ -275,7 +259,6 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool (
|
|||
}
|
||||
else
|
||||
this->base_shm_key_ = ACE_DEFAULT_SHM_KEY;
|
||||
#endif // ACE_HAS_SYSV_IPC
|
||||
|
||||
if (this->signal_handler_.register_handler (SIGSEGV, this) == -1)
|
||||
ACELIB_ERROR ((LM_ERROR,
|
||||
|
|
@ -384,9 +367,7 @@ ACE_Shared_Memory_Pool::init_acquire (size_t nbytes,
|
|||
counter < this->max_segments_;
|
||||
counter++)
|
||||
{
|
||||
#ifdef ACE_HAS_SYSV_IPC
|
||||
st[counter].key_ = this->base_shm_key_ + counter;
|
||||
#endif
|
||||
st[counter].shmid_ = 0;
|
||||
st[counter].used_ = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue