You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
492 B

3 years ago
3 years ago
  1. package page_writer
  2. type DirtyPages interface {
  3. AddPage(offset int64, data []byte, isSequential bool)
  4. FlushData() error
  5. ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64)
  6. Destroy()
  7. LockForRead(startOffset, stopOffset int64)
  8. UnlockForRead(startOffset, stopOffset int64)
  9. }
  10. func max(x, y int64) int64 {
  11. if x > y {
  12. return x
  13. }
  14. return y
  15. }
  16. func min(x, y int64) int64 {
  17. if x < y {
  18. return x
  19. }
  20. return y
  21. }
  22. func minInt(x, y int) int {
  23. if x < y {
  24. return x
  25. }
  26. return y
  27. }