discard abstract method

void discard({
  1. int offset = 0,
  2. int? length,
})

Hints the OS to drop [offset, offset + length) from the working set.

POSIX: madvise(MADV_DONTNEED). Windows currently validates the range but is a no-op for file-backed mappings, because DiscardVirtualMemory returns ERROR_USER_MAPPED_FILE for them.

Implementation

void discard({int offset = 0, int? length});