diff options
author | Hans Boehm <hboehm@google.com> | 2018-03-29 14:29:46 -0700 |
---|---|---|
committer | Hans Boehm <hboehm@google.com> | 2018-03-29 16:36:06 -0700 |
commit | 698aa163e1d5a0954e011dd93eb4912173f83031 (patch) | |
tree | c8a151bb6a643025fe34d54ff22d24d98d85af77 /compiler/optimizing/code_generator.h | |
parent | 7da5cea7288cd2dc412b1ea3568a800baeab778e (diff) |
Make atomics use for allocator counters consistent.
Use memory_order_relaxed atomics everywhere. Document what that means.
We were previously using seq_cst updates in some places. The only
benefit of that might have been for the expected invariants between
the counters, e.g. bytes_used < total_bytes_used, to actually hold.
But they didn't anyway because no care was taken to update them
in the correct order. And we were using relaxed (and even volatile)
accesses in other places.
Update max_bytes_used atomically, so that it can't decrease.
Bug: 31023171
Test: Build and boot AOSP
Change-Id: Icfca919d48c67899acb1798f5357f17e956099a6
Diffstat (limited to 'compiler/optimizing/code_generator.h')
0 files changed, 0 insertions, 0 deletions