[petsc-dev] Adding support memkind allocators in PETSc

Barry Smith bsmith at mcs.anl.gov
Tue Apr 28 22:34:15 CDT 2015


> On Apr 28, 2015, at 5:04 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>> How do you communicate to the accessor that the memory has been freed?
>>> 
>>  Accessor? What is accessor?
> 
> The code that accesses the memory behind the pointer (via the pointer or
> otherwise).

  The special malloc would need to save the locations at which it set the addresses and then switch the address to NULL. Then the code that used those locations would have to know that they that they may be set to NULL and hence check them before use.

  I am not saying this particular thing would be practical or not, just that if we had a concept of a malloc context for each malloc there are many games we could try that we couldn't try otherwise and this is just one of them.

  Barry





More information about the petsc-dev mailing list