# Mmap and memory alignment

**URL:** <https://discourse.julialang.org/t/mmap-and-memory-alignment/20665>\
**Category:** General Usage\
**Created:** [February 11, 2019, 2:57pm UTC](https://discourse.julialang.org/t/mmap-and-memory-alignment/20665 "2019-02-11T14:57:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [February 11, 2019, 4:29pm UTC](https://discourse.julialang.org/t/mmap-and-memory-alignment/20665/4 "2019-02-11T16:29:06Z")

</div>

One solution is to create a primitive type `Iaea40` covering the 40 bits of information and manually implementing the interface needed to reinterpret it as a `Particle` (with which you do the processing). So, from memory-mapped `Matrix{Iaea40}` the getters and setters would do the conversion to and from `Particle` i.e. `reinterpret(Particle, Iaea40)`. I never tried such an approach so this is somewhat theoretical but it should work 🙂

---

_[View the full topic](https://discourse.julialang.org/t/mmap-and-memory-alignment/20665)._
