PiJoules wrote:

(Sorry I think I accidentally edited your last comment rather than adding a new 
one)

> To ensure we don't destroy objects that weren't constructed, you can use a 
> guard variable of some sort, sure.  I'm not quite sure what the goal is, 
> here; are you trying to improve performance, or are you worried about the 
> function pointers for security?

Fewer atexit calls means fewer calls to malloc since the number of callbacks 
can dynamically grow.

> No, I mean for objects in different translation units.  I think the same 
> translation unit works like you think.  And different translation units maybe 
> works for non-inline variables, assuming the loader iterates in the right 
> direction?
>
> I think you might run into issues with inline variables?  Not sure if this 
> patch actually changes behavior for them.

Good points, I'll have to write more tests for this

https://github.com/llvm/llvm-project/pull/115788
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to