Re: [PATCH v5 1/7] strbuf: clarify API boundary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 11, 2023 at 3:48 PM Calvin Wan <calvinwan@xxxxxxxxxx> wrote:
> strbuf, as a generic and widely used structure across the codebase,
> should be limited as a library to only interact with primitives. Add
> documentation so future functions can appropriately be placed. Older
> functions that do not follow this boundary should eventually be moved or
> refactored.
>
> Signed-off-by: Calvin Wan <calvinwan@xxxxxxxxxx>
> ---
> diff --git a/strbuf.h b/strbuf.h
> @@ -1,6 +1,15 @@
> +/*
> + * NOTE FOR STRBUF DEVELOPERS
> + *
> + * The objects that this API interacts with should be limited to other
> + * primitives, however, there are older functions in here that interact
> + * with non-primitive objects which should eventually be moved out or
> + * refactored.
> + */

Sorry, I meant to send a follow-up to my previous email[1] but forgot.
In particular, I wanted to say that I think the second part of the
above comment (the "however" and everything which follows) ought to be
dropped since it will become stale once those "older functions" are
finally removed; it is likely nobody will remember to update this
comment. So, the above could rewritten something like this:

 /*
  * NOTE FOR STRBUF DEVELOPERS
  *
  * strbuf is a low-level primitive; as such it should interact only
  * with other low-level primitives. Do not introduce new functions
  * which interact with higher-level APIs.
  */

[1]: https://lore.kernel.org/git/CAPig+cTQg7XzORPHeD79aHEi1ggOjTPw9X02VPgxcV9uoBOBxg@xxxxxxxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux