* Returns how many times the passed buffer is pinned by this backend. * * Only works for shared memory buffers! */
| 400 | * Only works for shared memory buffers! |
| 401 | */ |
| 402 | static inline int32 |
| 403 | GetPrivateRefCount(Buffer buffer) |
| 404 | { |
| 405 | PrivateRefCountEntry *ref; |
| 406 | |
| 407 | Assert(BufferIsValid(buffer)); |
| 408 | Assert(!BufferIsLocal(buffer)); |
| 409 | |
| 410 | /* |
| 411 | * Not moving the entry - that's ok for the current users, but we might |
| 412 | * want to change this one day. |
| 413 | */ |
| 414 | ref = GetPrivateRefCountEntry(buffer, false); |
| 415 | |
| 416 | if (ref == NULL) |
| 417 | return 0; |
| 418 | return ref->refcount; |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | * Release resources used to track the reference count of a buffer which we no |
no test coverage detected