On Thu, 17 Aug 2023 at 14:32, Darin Ohashi <
doh...@gmail.com> wrote:
>
> Hello,
>
> If I am using a custom memory manager that can recycle memory between threads, would tsan flag that as a data race? So thread A allocates memory, uses it, then frees it to the memory manager. Then thread B allocates that same block of memory and uses it. Could tsan see that as a data race?
>
> I am getting data race messages for cases that don't look like they should be a data race, but the thread is writing into a block of memory that is "newly allocated" from my custom memory manager. It is possible that the block of memory was previously used on another thread.
Hi Darin,
From ThreadSantizer perspective a custom memory allocator is not
different from any other container. If it's implemented correctly,
then ThreadSantizer is not supposed to produce race reports.
> If so, is there a way to tell tsan about this behaviour so these cases aren't reported?
Fix bugs in the allocator ;)