Lines Matching refs:offset
255 bool Ashmem::WriteToAshmem(const void *data, int32_t size, int32_t offset) const
257 bool Ashmem::WriteToAshmem(const void *data, int32_t size, int32_t offset)
264 if (!CheckValid(size, offset, PROT_WRITE)) {
270 int ret = memcpy_s(tmpData + offset, memorySize_ - offset, reinterpret_cast<const char *>(data), size);
280 const void *Ashmem::ReadFromAshmem(int32_t size, int32_t offset) const
282 const void *Ashmem::ReadFromAshmem(int32_t size, int32_t offset)
285 if (!CheckValid(size, offset, PROT_READ)) {
290 return reinterpret_cast<const char *>(startAddr_) + offset;
293 bool Ashmem::CheckValid(int32_t size, int32_t offset, int cmd) const
298 if ((size < 0) || (size > memorySize_) || (offset < 0) || (offset > memorySize_)) {
299 UTILS_LOGE("%{public}s: , invalid parameter, size = %{public}d, memorySize_ = %{public}d, offset = %{public}d",
300 __func__, size, memorySize_, offset);
303 if (offset + size > memorySize_) {
304 UTILS_LOGE("%{public}s: , invalid parameter, size = %{public}d, memorySize_ = %{public}d, offset = %{public}d",
305 __func__, size, memorySize_, offset);