MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / userLock

Method userLock

src/backend/common/DefaultMemoryManager.cpp:349–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349void DefaultMemoryManager::userLock(const void *ptr) {
350 memory_info &current = this->getCurrentMemoryInfo();
351
352 lock_guard_t lock(this->memory_mutex);
353
354 auto locked_iter = current.locked_map.find(const_cast<void *>(ptr));
355 if (locked_iter != current.locked_map.end()) {
356 locked_iter->second.user_lock = true;
357 } else {
358 locked_info info = {false, true, 100}; // This number is not relevant
359
360 current.locked_map[const_cast<void *>(ptr)] = info;
361 }
362}
363
364void DefaultMemoryManager::userUnlock(const void *ptr) {
365 this->unlock(const_cast<void *>(ptr), true);

Callers 4

memLockFunction · 0.45
memLockFunction · 0.45
memLockFunction · 0.45
memLockFunction · 0.45

Calls 1

findMethod · 0.80

Tested by

no test coverage detected