Re: [PATCH 1/8] git-repack --max-pack-size: Add new file statics and struct fields

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/8] git-repack --max-pack-size: Add new file statics and struct fields

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:03

Dana How [off-list ref] writes:
... The fields
in object_entry are re-arranged & shrunk to save memory.
Is the driving principle "place fields with coarser alignment
requirements first in the struct"?  I noticed you have a handful
pointers and an off_t after two short fields.  Two shorts would
be likely to make the next field aligned suitable for an int,
but (1) if we ever add another short later that would not be
true anymore, and (2) I suspect a pointer and an off_t can be
longer than an int but int would never be longer than them.

Re: [PATCH 1/8] git-repack --max-pack-size: Add new file statics and struct fields

From: Dana How <hidden>
Date: 2016-06-15 22:43:03

On 4/8/07, Junio C Hamano [off-list ref] wrote:
Dana How [off-list ref] writes:
quoted
... The fields
in object_entry are re-arranged & shrunk to save memory.
Is the driving principle "place fields with coarser alignment
requirements first in the struct"?  I noticed you have a handful
pointers and an off_t after two short fields.  Two shorts would
be likely to make the next field aligned suitable for an int,
but (1) if we ever add another short later that would not be
true anymore, and (2) I suspect a pointer and an off_t can be
longer than an int but int would never be longer than them.
All true.  My objective was to save more memory than I had
"wasted" by adding the prev_pack field.  Since it appears
I'll be submitting the patchset yet again,  I'll make this
re-arrangement complete next time.

Thanks,
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help