page-locks/pins the memory
| 178 | |
| 179 | //! page-locks/pins the memory |
| 180 | bool pin() { |
| 181 | #if !defined(__WINDOWS__) |
| 182 | if (mlock(ptr, size) == 0) |
| 183 | #else |
| 184 | if (VirtualLock(ptr, size) != 0) |
| 185 | #endif |
| 186 | { |
| 187 | pinned = true; |
| 188 | return true; |
| 189 | } |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | //! unlocks/unpins the memory again |
| 194 | bool unpin() { |
no outgoing calls
no test coverage detected