Re: [PATCH 05/16] alloc.h: move ALLOC_GROW() functions from cache.h

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

 



On Thu, Feb 23, 2023 at 6:06 AM Derrick Stolee <derrickstolee@xxxxxxxxxx> wrote:
>
> On 2/23/2023 3:05 AM, Elijah Newren via GitGitGadget wrote:
> > From: Elijah Newren <newren@xxxxxxxxx>
> >
> > This allows us to replace includes of cache.h with includes
> > of the much smaller alloc.h in many places.
>
> > diff --git a/add-patch.c b/add-patch.c
> > index a86a92e1646..7fe6b66d866 100644
> > --- a/add-patch.c
> > +++ b/add-patch.c
> > @@ -1,5 +1,7 @@
> >  #include "cache.h"
> >  #include "add-interactive.h"
> > +#include "alloc.h"
> > +#include "gettext.h"
>
> I see here that you are not dropping cache.h, but are also adding
> gettext.h, too? Did you mean to replace cache.h with git-compat-util.h
> here, or will I see that change happen in a future patch?

Not intentional.  Often as I made changes, I also flipped cache.h to
git-compat-util.h manually, then found out what was missing and
started adding other headers.  Sometimes that worked, sometimes I
found that there was still more stuff directly in cache.h that was
needed.  When I backed out the change, I forgot to remove the
gettext.h inclusion.  (Though leaving it in doesn't hurt either, since
the file does clearly depend upon it.)

> > diff --git a/attr.c b/attr.c
> > index 1053dfcd4b6..657ee52229e 100644
> > --- a/attr.c
> > +++ b/attr.c
> > @@ -7,6 +7,7 @@
> >   */
> >
> >  #include "cache.h"
> > +#include "alloc.h"
>
> (Here's another example. Makes it more likely that this is on
> purpose in preparation for a full swap in the future. I'll
> stop mentioning this when I see it.)
>
> I also manually verified that the macros are an exact move
> from cache.h to alloc.h.

Yeah, since I moved code out of cache.h into alloc.h, and didn't make
cache.h depend upon alloc.h (because it really doesn't depend on it),
that means each file that does depend upon alloc.h needs to explicitly
include it.  I guess I could have made that more clear in the commit
message.



[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