void SCMOInstance::setHostName_l(const char* hostName, Uint32 len)
{
// Copy on Write is only necessary if a realloc() becomes necessary
- if (inst.mem->freeBytes < len)
+ if (inst.mem->freeBytes < ((len+8) & ~7))
{
_copyOnWrite();
}
void SCMOInstance::setNameSpace_l(const char* nameSpace, Uint32 len)
{
// Copy on Write is only necessary if a realloc() becomes necessary
- if (inst.mem->freeBytes < len)
+ if (inst.mem->freeBytes < ((len+8) & ~7))
{
_copyOnWrite();
}
// Init memory from unaligned start up to the size required with alignment
// to zero.
memset(&((char*)(*pmem))[start],0,(size_t)reqAlignSize);
+ PEGASUS_DEBUG_ASSERT(
+ ((*pmem)->freeBytes+(*pmem)->startOfFreeSpace) == (*pmem)->totalSize);
return alignedStart;
}