* Conditionalize Darwin imports with canImport instead of os
* Update DataProtocol.swift
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
---------
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
`unmap` is a non-portable function as it is not part of the C standard.
The correct spelling for this on Windows is `UnmapViewOfFile` which
expects that the data to be mapped by `MapViewOfFile`. This cannot be
used for freeing memory in general.
* fix memory binding
* use `load(as:)` instead of binding memory
* Use temporary binding rather than `bindMemory`
* use `load(as:)` and `storeBytes(of:as:)` as appropriate
* use temporary binding rather than binding assertions
* add a note about index validation