Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-09 Thread Bill Wendling
On Sun, Sep 8, 2024 at 3:07 AM Martin Uecker wrote: > > Am Sonntag, dem 08.09.2024 um 02:09 -0700 schrieb Bill Wendling: > > On Fri, Sep 6, 2024 at 10:50 PM Martin Uecker wrote: > > > > > > Am Freitag, dem 06.09.2024 um 13:59 -0700 schrieb Bill Wendling: > > > > On Fri, Sep 6, 2024 at 12:32 PM Ma

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-09 Thread Qing Zhao
> On Sep 9, 2024, at 10:20, Jakub Jelinek wrote: > > On Mon, Sep 09, 2024 at 02:10:05PM +, Qing Zhao wrote: >> Okay, now after finishing reading all the discussion so far, I realized that >> we are back to the previous pointer approach: >> >> __builtin_get_counted_by (p->FAM) >> >> Works

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-09 Thread Jakub Jelinek
On Mon, Sep 09, 2024 at 02:10:05PM +, Qing Zhao wrote: > Okay, now after finishing reading all the discussion so far, I realized that > we are back to the previous pointer approach: > > __builtin_get_counted_by (p->FAM) > > Works as: > > If (has_counted_by (p->FAM)) > return &p->COUNT; >

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-09 Thread Qing Zhao
Okay, now after finishing reading all the discussion so far, I realized that we are back to the previous pointer approach: __builtin_get_counted_by (p->FAM) Works as: If (has_counted_by (p->FAM)) return &p->COUNT; else return (void *)0; Then the user will use it as: auto p = __builtin_get

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-09 Thread Qing Zhao
> On Sep 7, 2024, at 02:16, Martin Uecker wrote: > > Am Samstag, dem 07.09.2024 um 00:12 + schrieb Qing Zhao: >> Now, if >> >> 1. __builtin_get_counted_by should return a LVALUE instead of a pointer >> (required by CLANG’s design) >> And >> 2. It’s better not to change the behavior of __b

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-08 Thread Martin Uecker
Am Sonntag, dem 08.09.2024 um 02:09 -0700 schrieb Bill Wendling: > On Fri, Sep 6, 2024 at 10:50 PM Martin Uecker wrote: > > > > Am Freitag, dem 06.09.2024 um 13:59 -0700 schrieb Bill Wendling: > > > On Fri, Sep 6, 2024 at 12:32 PM Martin Uecker wrote: > > > > > > > ... > > > > > > > > My reco

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-08 Thread Martin Uecker
Am Sonntag, dem 08.09.2024 um 02:26 -0700 schrieb Bill Wendling: > On Sat, Sep 7, 2024 at 12:21 AM Jakub Jelinek wrote: > > On Sat, Sep 07, 2024 at 07:50:29AM +0200, Martin Uecker wrote: > > > > 2. Apple's implementation supports expressions in the '__counted_by' > > > > attribute, thus the 'cou

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-08 Thread Bill Wendling
On Fri, Sep 6, 2024 at 11:16 PM Martin Uecker wrote: > > Am Samstag, dem 07.09.2024 um 00:12 + schrieb Qing Zhao: > > Now, if > > > > 1. __builtin_get_counted_by should return a LVALUE instead of a pointer > > (required by CLANG’s design) > > And > > 2. It’s better not to change the behavior

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-08 Thread Bill Wendling
On Fri, Sep 6, 2024 at 5:12 PM Qing Zhao wrote: > > Now, if > > 1. __builtin_get_counted_by should return a LVALUE instead of a pointer > (required by CLANG’s design) > And > 2. It’s better not to change the behavior of __builtin_choose_expr. > > Then the solution left is: > > __builtin_get_count

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-08 Thread Bill Wendling
On Fri, Sep 6, 2024 at 10:50 PM Martin Uecker wrote: > > Am Freitag, dem 06.09.2024 um 13:59 -0700 schrieb Bill Wendling: > > On Fri, Sep 6, 2024 at 12:32 PM Martin Uecker wrote: > > > > > > Am Freitag, dem 06.09.2024 um 13:59 + schrieb Qing Zhao: > > > > > > > > > On Sep 5, 2024, at 18:22, B

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-07 Thread Jakub Jelinek
On Sat, Sep 07, 2024 at 07:50:29AM +0200, Martin Uecker wrote: > > 2. Apple's implementation supports expressions in the '__counted_by' > > attribute, thus the 'count' may be an R-value that can't have its > > address taken. > > > > [1] > > https://discourse.llvm.org/t/rfc-introducing-new-clang

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Martin Uecker
Am Samstag, dem 07.09.2024 um 08:16 +0200 schrieb Martin Uecker: > Am Samstag, dem 07.09.2024 um 00:12 + schrieb Qing Zhao: > > Now, if > > > > 1. __builtin_get_counted_by should return a LVALUE instead of a pointer > > (required by CLANG’s design) > > And > > 2. It’s better not to change the

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Martin Uecker
Am Samstag, dem 07.09.2024 um 00:12 + schrieb Qing Zhao: > Now, if > > 1. __builtin_get_counted_by should return a LVALUE instead of a pointer > (required by CLANG’s design) > And > 2. It’s better not to change the behavior of __builtin_choose_expr. > > Then the solution left is: > > __buil

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Martin Uecker
Am Freitag, dem 06.09.2024 um 13:59 -0700 schrieb Bill Wendling: > On Fri, Sep 6, 2024 at 12:32 PM Martin Uecker wrote: > > > > Am Freitag, dem 06.09.2024 um 13:59 + schrieb Qing Zhao: > > > > > > > On Sep 5, 2024, at 18:22, Bill Wendling wrote: > > > > > > > > Hi Qing, > > > > > > > > So

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Qing Zhao
Now, if 1. __builtin_get_counted_by should return a LVALUE instead of a pointer (required by CLANG’s design) And 2. It’s better not to change the behavior of __builtin_choose_expr. Then the solution left is: __builtin_get_counted_by (p->FAM) returns a LVALUE as p->COUNT if p->FAM has a counted

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Bill Wendling
On Fri, Sep 6, 2024 at 12:32 PM Martin Uecker wrote: > > Am Freitag, dem 06.09.2024 um 13:59 + schrieb Qing Zhao: > > > > > On Sep 5, 2024, at 18:22, Bill Wendling wrote: > > > > > > Hi Qing, > > > > > > Sorry for my late reply. > > > > > > On Thu, Aug 29, 2024 at 7:22 AM Qing Zhao wrote: >

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Martin Uecker
Am Freitag, dem 06.09.2024 um 13:59 + schrieb Qing Zhao: > > > On Sep 5, 2024, at 18:22, Bill Wendling wrote: > > > > Hi Qing, > > > > Sorry for my late reply. > > > > On Thu, Aug 29, 2024 at 7:22 AM Qing Zhao wrote: > > > > > > Hi, > > > > > > Thanks for the information. > > > > > > Y

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-06 Thread Qing Zhao
> On Sep 5, 2024, at 18:22, Bill Wendling wrote: > > Hi Qing, > > Sorry for my late reply. > > On Thu, Aug 29, 2024 at 7:22 AM Qing Zhao wrote: >> >> Hi, >> >> Thanks for the information. >> >> Yes, providing a unary operator similar as __counted_by(PTR) as suggested by >> multiple peopl

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-09-05 Thread Bill Wendling
Hi Qing, Sorry for my late reply. On Thu, Aug 29, 2024 at 7:22 AM Qing Zhao wrote: > > Hi, > > Thanks for the information. > > Yes, providing a unary operator similar as __counted_by(PTR) as suggested by > multiple people previously is a cleaner approach. > > Then the programmer will use the fo

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-29 Thread Qing Zhao
Hi, Thanks for the information. Yes, providing a unary operator similar as __counted_by(PTR) as suggested by multiple people previously is a cleaner approach. Then the programmer will use the following: __builtin_choose_expr( __builtin_has_attribute (__p->FAM, "counted_by”)

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-27 Thread Bill Wendling
On Tue, Aug 27, 2024 at 6:58 AM Qing Zhao wrote: > > On Aug 27, 2024, at 02:17, Martin Uecker wrote: > > Am Montag, dem 26.08.2024 um 17:21 -0700 schrieb Kees Cook: > >> On Mon, Aug 26, 2024 at 11:01:08PM +0200, Martin Uecker wrote: > >>> Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-27 Thread Qing Zhao
> On Aug 27, 2024, at 02:17, Martin Uecker wrote: > > Am Montag, dem 26.08.2024 um 17:21 -0700 schrieb Kees Cook: >> On Mon, Aug 26, 2024 at 11:01:08PM +0200, Martin Uecker wrote: >>> Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook: On Mon, Aug 26, 2024 at 07:30:15PM +, Qing

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-27 Thread Qing Zhao
> On Aug 26, 2024, at 17:01, Martin Uecker wrote: > > Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook: >> On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: >>> Hi, Martin, >>> >>> Looks like that there is some issue when I tried to use the _Generic for >>> the testing case

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-27 Thread Qing Zhao
> On Aug 26, 2024, at 16:30, Kees Cook wrote: > > On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: >> Hi, Martin, >> >> Looks like that there is some issue when I tried to use the _Generic for the >> testing cases, and then I narrowed down to a >> small testing case that shows the p

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-27 Thread Qing Zhao
> On Aug 26, 2024, at 15:46, Bill Wendling wrote: > > On Wed, Aug 21, 2024 at 8:43 AM Martin Uecker wrote: >> >> Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: But if we changed it to return a void pointer, we could make this a compile-time check: au

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Martin Uecker
Am Montag, dem 26.08.2024 um 17:21 -0700 schrieb Kees Cook: > On Mon, Aug 26, 2024 at 11:01:08PM +0200, Martin Uecker wrote: > > Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook: > > > On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: > > > > Hi, Martin, > > > > > > > > Looks li

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Kees Cook
On Mon, Aug 26, 2024 at 11:01:08PM +0200, Martin Uecker wrote: > Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook: > > On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: > > > Hi, Martin, > > > > > > Looks like that there is some issue when I tried to use the _Generic for > > >

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Martin Uecker
Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook: > On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: > > Hi, Martin, > > > > Looks like that there is some issue when I tried to use the _Generic for > > the testing cases, and then I narrowed down to a > > small testing case tha

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Kees Cook
On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote: > Hi, Martin, > > Looks like that there is some issue when I tried to use the _Generic for the > testing cases, and then I narrowed down to a > small testing case that shows the problem without any change to GCC. > > [opc@qinzhao-ol8u3-x

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Martin Uecker
Am Montag, dem 26.08.2024 um 19:30 + schrieb Qing Zhao: > Hi, Martin, > > Looks like that there is some issue when I tried to use the _Generic for the > testing cases, and then I narrowed down to a > small testing case that shows the problem without any change to GCC. > > [opc@qinzhao-ol8u3-

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Bill Wendling
On Thu, Aug 22, 2024 at 8:03 AM Qing Zhao wrote: > > On Aug 21, 2024, at 18:08, Bill Wendling wrote: > >> For the unary operator __counted_by(PTR), “PTR” must have a counted_by > >> attribute, if not, there will be a compilation time error. > >> > >> Then the user could write the following cod

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Bill Wendling
On Wed, Aug 21, 2024 at 8:43 AM Martin Uecker wrote: > > Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: > > > > > > But if we changed it to return a void pointer, we could make this > > > a compile-time check: > > > > > > auto ret = __builtin_get_counted_by(__p->FAM); > > > > > > _

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-26 Thread Qing Zhao
Hi, Martin, Looks like that there is some issue when I tried to use the _Generic for the testing cases, and then I narrowed down to a small testing case that shows the problem without any change to GCC. [opc@qinzhao-ol8u3-x86 gcc]$ cat t1.c struct annotated { char b; int c[]; } *array_annota

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-22 Thread Qing Zhao
> On Aug 21, 2024, at 18:08, Bill Wendling wrote: > >>> >>> to test. >> >> For the unary operator __counted_by(PTR), “PTR” must have a counted_by >> attribute, if not, there will be a compilation time error. >> >> Then the user could write the following code: >> >> If __builtin_has_att

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-22 Thread Qing Zhao
> On Aug 21, 2024, at 17:54, Bill Wendling wrote: > >> if (__builtin_get_counted_by(p->array)) { >>size_t max_value = >> type_max(typeof(*__builtin_get_counted_by(p->array))); >>if (count > type_max) >>...fail cleanly... >>*__builtin_get_counted_by(p->ar

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-22 Thread Qing Zhao
Hi, Bill, Thank you for the info. > On Aug 21, 2024, at 17:36, Bill Wendling wrote: > >> >> Bill, could you please provide a little bit more info on the possibility of >> a new builtin __builtin_has_attribute() in CLANG? >> > From what I gathered, it would require some moderate surgery to

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Bill Wendling
On Wed, Aug 21, 2024 at 2:54 PM Bill Wendling wrote: > > On Wed, Aug 21, 2024 at 10:44 AM Kees Cook wrote: > > > > On Wed, Aug 21, 2024 at 03:27:56PM +, Qing Zhao wrote: > > > > On Aug 21, 2024, at 10:45, Martin Uecker wrote: > > > > > > > > Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Bill Wendling
On Wed, Aug 21, 2024 at 10:52 AM Qing Zhao wrote: > > On Aug 21, 2024, at 11:43, Martin Uecker wrote: > > Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: > >>> > >>> But if we changed it to return a void pointer, we could make this > >>> a compile-time check: > >>> > >>> auto ret =

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Bill Wendling
On Wed, Aug 21, 2024 at 10:44 AM Kees Cook wrote: > > On Wed, Aug 21, 2024 at 03:27:56PM +, Qing Zhao wrote: > > > On Aug 21, 2024, at 10:45, Martin Uecker wrote: > > > > > > Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb Martin Uecker: > > >> Am Mittwoch, dem 21.08.2024 um 14:12 + sc

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Bill Wendling
On Tue, Aug 20, 2024 at 6:41 AM Qing Zhao wrote: > > On Aug 20, 2024, at 05:58, Richard Biener > > wrote: > > > > On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote: > >> > >> With the addition of the 'counted_by' attribute and its wide roll-out > >> within the Linux kernel, a use case has been fo

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Qing Zhao
> On Aug 21, 2024, at 11:43, Martin Uecker wrote: > > Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: >>> >>> But if we changed it to return a void pointer, we could make this >>> a compile-time check: >>> >>> auto ret = __builtin_get_counted_by(__p->FAM); >>> >>> _Generic(ret

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Kees Cook
On Wed, Aug 21, 2024 at 05:43:42PM +0200, Martin Uecker wrote: > Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: > > > > > > But if we changed it to return a void pointer, we could make this > > > a compile-time check: > > > > > > auto ret = __builtin_get_counted_by(__p->FAM); > >

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Kees Cook
On Wed, Aug 21, 2024 at 03:27:56PM +, Qing Zhao wrote: > > On Aug 21, 2024, at 10:45, Martin Uecker wrote: > > > > Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb Martin Uecker: > >> Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao: > >> > >>> > >>> Yes, I do feel that the ap

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Martin Uecker
Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao: > > > > But if we changed it to return a void pointer, we could make this > > a compile-time check: > > > > auto ret = __builtin_get_counted_by(__p->FAM); > > > > _Generic(ret, void*: (void)0, default: *ret = COUNT); > > Is there an

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Qing Zhao
> On Aug 21, 2024, at 10:45, Martin Uecker wrote: > > Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb Martin Uecker: >> Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao: >> >>> >>> Yes, I do feel that the approach __builtin_get_counted_by is not very good. >>> Maybe it’s bette

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Qing Zhao
> On Aug 21, 2024, at 10:34, Martin Uecker wrote: > > Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao: > > ... >> >>> + if (__builtin_get_counted_by (__p->FAM)) \ + *(__builtin_get_counted_by(__p->FAM)) = COUNT; \ How to improve it? (Thanks a lot for your

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Martin Uecker
Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb Martin Uecker: > Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao: > > > > > Yes, I do feel that the approach __builtin_get_counted_by is not very good. > > Maybe it’s better to provide > > A. __builtin_set_counted_by > > or > > B.

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Martin Uecker
Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao: ... > > > > > > + if (__builtin_get_counted_by (__p->FAM)) \ > > > + *(__builtin_get_counted_by(__p->FAM)) = COUNT; \ > > > > > > How to improve it? (Thanks a lot for your suggestion). > > > > There's lack of syntactic guarantee t

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Qing Zhao
(Resend since the previous one has no subject). > On Aug 21, 2024, at 04:44, Richard Biener wrote: > > On Tue, Aug 20, 2024 at 3:41 PM Qing Zhao wrote: >> >> >> >>> On Aug 20, 2024, at 05:58, Richard Biener >>> wrote: >>> >>> On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote: Wi

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-21 Thread Richard Biener
On Tue, Aug 20, 2024 at 3:41 PM Qing Zhao wrote: > > > > > On Aug 20, 2024, at 05:58, Richard Biener > > wrote: > > > > On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote: > >> > >> With the addition of the 'counted_by' attribute and its wide roll-out > >> within the Linux kernel, a use case has b

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-20 Thread Qing Zhao
> On Aug 20, 2024, at 05:58, Richard Biener wrote: > > On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote: >> >> With the addition of the 'counted_by' attribute and its wide roll-out >> within the Linux kernel, a use case has been found that would be very >> nice to have for object allocators: b

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-20 Thread Richard Biener
On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote: > > With the addition of the 'counted_by' attribute and its wide roll-out > within the Linux kernel, a use case has been found that would be very > nice to have for object allocators: being able to set the counted_by > counter variable without knowi

Re: [PATCH v1] Provide new GCC builtin __builtin_get_counted_by [PR116016]

2024-08-15 Thread Kees Cook
On Tue, Aug 13, 2024 at 03:33:26PM +, Qing Zhao wrote: > With the addition of the 'counted_by' attribute and its wide roll-out > within the Linux kernel, a use case has been found that would be very > nice to have for object allocators: being able to set the counted_by > counter variable withou