kees wrote:

> > I'd expect some kind of diagnostic when the specified field doesn't have a 
> > corresponding counted_by field.
> 
> So there's a complication with that. The use case for this builtin is to 
> automatically set the `count` field during allocation in the Linux kernel. 
> (It could be used elsewhere, but Linux is why we're doing this now.) From my 
> understanding, @kees wants to have a way to get the `count` field without 
> having to change the allocator's prototype. (Is that correct?) That's not 
> currently possible, or at least we haven't found a way to do it yet.

Yup, that's correct. There needs to be a way to programmatically determine what 
the "counter" variable is so that we don't have to create a separate (and 
ultimately redundant) allocator API for FAM structs that use "counted_by". It 
could be entirely automatic. Some more background details are here:

https://lore.kernel.org/lkml/20240807235433.work.317-k...@kernel.org/

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

Reply via email to