Re: ffi.copy/ffi.string fails with volatile-qualified char array

  • From: Mike Pall <mike-1311@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 4 Nov 2013 14:13:35 +0100

Justin Cormack wrote:
> Does LuaJIT respect volatile semantics in terms of (not) optimising it?

No, but that's an orthogonal issue to the original question.

['volatile' is rather complex to implement correctly and the weak
guarantees are pretty useless on a modern CPU. Memory barriers and
optimization barriers are conceptually much cleaner. The latter
are already implemented internally (XBAR), but there's no API to
emit them explicitly. But then ... nobody asked for those, yet.]

--Mike

Other related posts: