From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git <git@vger.kernel.org>
Subject: Re: Project idea: strbuf allocation modes
Date: Tue, 22 Apr 2014 12:38:18 +0200 [thread overview]
Message-ID: <vpqa9bdsl7p.fsf@anie.imag.fr> (raw)
In-Reply-To: <535631C0.2020100@alum.mit.edu> (Michael Haggerty's message of "Tue, 22 Apr 2014 11:09:20 +0200")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> On 04/22/2014 09:07 AM, Matthieu Moy wrote:
>
> The whole point of the change is to *allow* strbuf to be used in
> performance-critical stuff.
OK. It should not make the current use of strbuf any harder anyway.
>> In your proposal, would STRBUF_OWNS_MEMORY be a constant, or a flag that
>> change when the internal buffer needs reallocation? My understanding is
>> that it should change (if STRBUF_FIXED_MEMORY is not set), and the
>> strbuf wrapping a preallocated buffer would become a "normal" strbuf
>> when its internal buffer grows.
>
> Correct. STRBUF_OWNS_MEMORY itself is of course a constant like 0x02
Yes, I meant "the STRBUF_OWNS_MEMORY flag".
> How does the size of this project compare to what you are looking for
> for your Ensimag students?
I do not yet have applications for this project (it should come within
the next few days). It greatly depends on students and team size. I
always start with a "warm up patch" (like GSoC's microprojects), and
depending on the time taken for it, I direct students to bigger or
smaller projects.
Your proposal is a bit tricky (it requires a good understanding of C and
memory management), but it is a purely local change (i.e. you can take
strbuf.[cf] out of Git's source code and hack it as a ~500 LOC project,
unit-test and document the result in a self-contained way), so it should
be doable. Using the new API features here and there in Git's source
code is another story though.
I've added the proposal with a link to this discussion here:
https://git.wiki.kernel.org/index.php/SmallProjectsIdeas#Allow_finer_memory_management_in_the_strbuf_API
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
prev parent reply other threads:[~2014-04-22 10:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-08 15:44 Students project on Git (Ensimag) Matthieu Moy
2014-04-18 13:50 ` Project idea: strbuf allocation modes Michael Haggerty
2014-04-18 17:21 ` Junio C Hamano
2014-04-18 20:04 ` Michael Haggerty
2014-04-19 0:55 ` Junio C Hamano
2014-04-22 7:07 ` Matthieu Moy
2014-04-22 9:09 ` Michael Haggerty
2014-04-22 10:38 ` Matthieu Moy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqa9bdsl7p.fsf@anie.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.