> On Aug 29, 2016, at 8:56 AM, Zachary Turner <ztur...@google.com> wrote:
> 
> How about making it a std::unique_ptr<std::atomic<lldb::addr_t>>?  This way 
> there's no risk of re-introducing a potential race, and copying still works.

lldb_private::Address is a member variable in lldb_private::Symbol and it needs 
to say as small as possible as lldb_private::Symbol is the number one memory 
hog in LLDB. Adding a unique pointer would make each address now have two 
memory entries: one for the Address (on the stack or heap) and one for the 
std::atomic on the heap. Address needs to say simple. I agree with you that we 
should rely upon mutexes to take care of threading issues and that Address 
probably shouldn't have to use std::atomic. Lets try and get rid of the atomic 
and fix the code that was having the race by using appropriate threading 
constructs.

Greg


_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to