Could be something as simple as hook and loop tape. One side is permanently/semi-permanently affixed to the slide the other side gets swapped based on x criteria. That's how I'd do it. The military loves velcro.
I was in a non-US military and we used electrical tape - two or three strips around rifle magazines.