public function Init($numBits) { if (is_string($numBits)) { $numBits = intval($numBits); } if ($numBits == 0) { $this->map = array(); $this->numBits = 0; $this->numWords = 0; return; } $this->numBits = $numBits; $this->numWords = LsRoundUp($numBits / 32, 1); $this->map = array(); for ($w = 0; $w < $this->numWords; $w++) { $this->map[$w] = 0x0; } }
public function SetQueueDepth($qDepth, $msgMemSize) { if (is_string($qDepth)) { $qDepth = intval($qDepth); } if (is_string($msgMemSize)) { $msgMemSize = intval($msgMemSize); } $this->queueDepth = $qDepth; $this->msgMemSize = $msgMemSize; // // Set the queue item entry size. // $this->qeSize = LsQE::GetSize(); $this->msgMemOffset = LsRoundUp(LsShmQueue::HEADER_SIZE + $this->qeSize * $qDepth, 1024); $this->shmSize = LsRoundUp($this->msgMemOffset + $this->msgMemSize, 1024); }
private static function OpenCatalogSharedMemory($key, $size) { // // Round up the size to our minimum size. // $size = LsRoundUp($size, LsTinyCache::CATALOG_MIN_SIZE); return LsTinyCache::CreateShmObject($key, $size + LsTinyCache::HEADER_SIZE); }