Messages in this thread | | | Subject | Re: [PATCH] NTFS: Change string pointers to string constants. | From | Joe Perches <> | Date | Mon, 07 Dec 2009 17:47:13 -0800 |
| |
On Tue, 2009-12-08 at 00:57 +0000, Anton Altaparmakov wrote: > Can you please explain the rational for making this change?
Perhaps it's not worth much, but it saves a pointer reference.
$ cat pointer.c #include <string.h> #include <stdio.h>
int main (int argc, char** argv) { static const char *foo = "abcdefg"; printf("%s\n", foo); return 0; }
$ gcc -c pointer.c $ size pointer.o text data bss dec hex filename 37 4 0 41 29 pointer.o
$ cat reference.c #include <string.h> #include <stdio.h>
int main (int argc, char** argv) { static const char foo[] = "abcdefg"; printf("%s\n", foo); return 0; }
$ gcc -c reference.c $ size reference.o text data bss dec hex filename 36 0 0 36 24 reference.o
| |