diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-24 03:23:59 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-24 03:23:59 +0200 |
commit | 738e4de01332a10edd30149aa998f8ed403c12ed (patch) | |
tree | d6ec6404e76ee5d661e4ddfe5e1809ff8acf4ef5 /docs | |
parent | 8f8ee534a7799cba8c953fffabe3b9c5571b3eb7 (diff) | |
download | busybox-w32-738e4de01332a10edd30149aa998f8ed403c12ed.tar.gz busybox-w32-738e4de01332a10edd30149aa998f8ed403c12ed.tar.bz2 busybox-w32-738e4de01332a10edd30149aa998f8ed403c12ed.zip |
English fixes to docs/smallint.txt
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/smallint.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/smallint.txt b/docs/smallint.txt index df6796447..b57dfd775 100644 --- a/docs/smallint.txt +++ b/docs/smallint.txt | |||
@@ -8,14 +8,15 @@ | |||
8 | 8 | ||
9 | I think that this optimization is wrong. | 9 | I think that this optimization is wrong. |
10 | index_in_str_array returns int. At best, compiler will use it as-is. | 10 | index_in_str_array returns int. At best, compiler will use it as-is. |
11 | At worst, compiler will try to make sure that it is properly casted | 11 | At worst, compiler will try to make sure that it is properly cast |
12 | into a byte, which probably results in "n = n & 0xff" on many architectures. | 12 | into a byte, which probably results in "n = n & 0xff" on many architectures. |
13 | 13 | ||
14 | You save nothing on space here because i is not stored on-stack, | 14 | You save nothing on space here because i is not stored on-stack, |
15 | gcc will keep it in register. And even it is *is* stored, | 15 | gcc will keep it in register. And even if it *is* stored, |
16 | it is *stack* storage, which is cheap (unlike data/bss). | 16 | it is *stack* storage, which is cheap (unlike data/bss). |
17 | 17 | ||
18 | small[u]ints are useful _mostly_ for: | 18 | small[u]ints are useful _mostly_ for: |
19 | |||
19 | (a) flag variables | 20 | (a) flag variables |
20 | (a1) global flag variables - make data/bss smaller | 21 | (a1) global flag variables - make data/bss smaller |
21 | (a2) local flag variables - "a = 5", "a |= 0x40" are smaller | 22 | (a2) local flag variables - "a = 5", "a |= 0x40" are smaller |
@@ -26,10 +27,11 @@ small[u]ints are useful _mostly_ for: | |||
26 | movl $0x0,(%eax) is "c7 00 00 00 00 00" | 27 | movl $0x0,(%eax) is "c7 00 00 00 00 00" |
27 | movb $0x0,(%eax) is "c6 00 00" | 28 | movb $0x0,(%eax) is "c6 00 00" |
28 | (b) small integer structure members, when you have many such | 29 | (b) small integer structure members, when you have many such |
29 | structures allocated, | 30 | structures allocated, |
30 | or when these are global objects of this structure type | 31 | or when these are global objects of this structure type |
31 | 32 | ||
32 | small[u]ints are *NOT* useful for: | 33 | small[u]ints are *NOT* useful for: |
34 | |||
33 | (a) function parameters and return values - | 35 | (a) function parameters and return values - |
34 | they are pushed on-stack or stored in registers, bytes here are *harder* | 36 | they are pushed on-stack or stored in registers, bytes here are *harder* |
35 | to deal with than ints | 37 | to deal with than ints |