()
| 490 | } |
| 491 | |
| 492 | func (ref *pageRef) unref() { |
| 493 | if atomic.CompareAndSwapUint32(&ref.once, 0, 1) { |
| 494 | ref.pages.unref() |
| 495 | ref.pages.clear() |
| 496 | ref.pages = nil |
| 497 | ref.offset = 0 |
| 498 | ref.cursor = 0 |
| 499 | ref.length = 0 |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | func (ref *pageRef) Len() int { return int(ref.Size() - ref.cursor) } |
| 504 |