[PATCH] Intercept allocation to skim allocated types
John McCall
rjmccall at apple.com
Tue Feb 26 09:53:44 PST 2013
On Feb 24, 2013, at 12:38 AM, Dai MIKURUBE <dmikurube at acm.org> wrote:
> Hi Douglas and John,
>
> I started to try your approach, but I'm still not sure what it does, and still a little doubtful that it's easy to catch allocation by non-global (in-class) operator news. When a project has 100 in-class operator news, doesn't it need to prepare 101 replacement functions? If it needs, I think it's so unrealistic. We cannot track all changes in a big project (e.g. WebKit). If a developer adds a new class with its local operator new, it's impossible to track all such local operator news.
>
> Could you tell me make sure 1) what should happen in the compiler and 2) what replacement functions should be added, in the simple example below?
>
> (Also, I'd like to know where is the DWARF code in Clang you mentioned.)
Okay, here's the deal.
I don't think we're really interested in taking your original language extension into mainline clang. It's invasive, it's complicated, it's novel, and it doesn't seem to have broad applicability.
Doug and I were suggesting adding infrastructure to LLVM under which arbitrary calls could be annotated with metadata which would potentially survive into DWARF. This would be a broadly-applicable feature that could be used by potentially many projects. This would be a lot of work on your part, but as a carrot, we would be open to an extension which merely annotates an operator new call using this new LLVM feature. It may not, however, actually achieve your purposes that well; I don't know them well enough to speculate.
Ultimately, however, this is an open-source project, and you are welcome to maintain your patch out-of-tree.
John.
More information about the cfe-commits
mailing list