paritytech / parity-db

Experimental blockchain database
Apache License 2.0
263 stars 59 forks source link

Make `madvise_random` compatible with non-Unix OS #221

Closed shamilsan closed 1 year ago

shamilsan commented 1 year ago

Fixes #220.

nazar-pc commented 1 year ago

@arkpar could you release this as a new version? Just hit this in Windows CI. Also would be great to add macOS and Windows to CI here.

arkpar commented 1 year ago

published as v0.4.11

nazar-pc commented 1 year ago

Now I'm curious why not using https://docs.rs/memmap2/latest/memmap2/struct.Advice.html with .advise() methods on with memmap2? It does the same thing internally, but spared you from using unsafe libc::madvise (and takes care of alignment requirement for its argument).

arkpar commented 1 year ago

advise was not available in memmap2-rs back when this code was originally written. It makes sense to switch now indeed.