develooper Front page | perl.perl5.porters | Postings from February 2006

RE: Change 27290: Using U8 rather than size type shrinks the body_details table.

Thread Next
From:
Jan Dubois
Date:
February 23, 2006 11:39
Subject:
RE: Change 27290: Using U8 rather than size type shrinks the body_details table.
Message ID:
024a01c638b0$c8142200$ee17a8c0@candy
On Thu, 23 Feb 2006, Nicholas Clark wrote:
> 
> Change 27290 by nicholas@nicholas-saigo on 2006/02/23 19:15:48
> 
> 	Using U8 rather than size type shrinks the body_details table.

But isn't accessing an unaligned U8 slower than accessing an aligned
size_t?  This optimization can at most save a few hundred bytes globally,
so it would not be worth any slowdown at all.

Cheers,
-Jan
 
> Affected files ...
> 
> ... //depot/perl/sv.c#1162 edit
> 
> Differences ...
> 
> ==== //depot/perl/sv.c#1162 (text) ====
> Index: perl/sv.c
> --- perl/sv.c#1161~27289~	2006-02-23 10:00:19.000000000 -0800
> +++ perl/sv.c	2006-02-23 11:15:48.000000000 -0800
> @@ -842,9 +842,9 @@
>  */
> 
>  struct body_details {
> -    size_t body_size;	/* Size to allocate  */
> -    size_t copy;	/* Size of structure to copy (may be shorter)  */
> -    size_t offset;
> +    U8 body_size;	/* Size to allocate  */
> +    U8 copy;	/* Size of structure to copy (may be shorter)  */
> +    U8 offset;
>      bool cant_upgrade;	/* Cannot upgrade this type */
>      bool zero_nv;	/* zero the NV when upgrading from this */
>      bool arena;		/* Allocated from an arena */
> End of Patch.



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About