From: Junio C Hamano Date: Thu, 12 Aug 2010 17:22:41 GMT Subject: Re: [PATCH 05/10] Add string-specific memory pool Message-ID: <7vmxsru4ny.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100809223442.GA4429@burratino> Jonathan Nieder writes: > diff --git a/Makefile b/Makefile > index e7c33ec..24103c9 100644 > --- a/Makefile > +++ b/Makefile > @@ -415,6 +415,7 @@ TEST_PROGRAMS_NEED_X += test-path-utils > TEST_PROGRAMS_NEED_X += test-run-command > TEST_PROGRAMS_NEED_X += test-sha1 > TEST_PROGRAMS_NEED_X += test-sigchain > +TEST_PROGRAMS_NEED_X += test-string-pool > TEST_PROGRAMS_NEED_X += test-treap > TEST_PROGRAMS_NEED_X += test-index-version Does your Makefile do the right thing to vcs-svn/*.[oa] upon "make clean"? > diff --git a/vcs-svn/string_pool.c b/vcs-svn/string_pool.c > new file mode 100644 > index 0000000..550f0e5 > --- /dev/null > +++ b/vcs-svn/string_pool.c > @@ -0,0 +1,102 @@ > ... > +uint32_t pool_intern(const char *key) > +{ > + /* Canonicalize key */ > + struct node *match = NULL; > + uint32_t key_len; > + if (key == NULL) > + return ~0; > + key_len = strlen(key) + 1; > + struct node *node = node_pointer(node_alloc(1)); Please fix decl-after-stmt here.