$ cat struct.c
#include <stdio.h>
struct {
short w1;
short w2;
int x;
char y1;
char y2;
int z;
} t;
int main() {
printf("struct t size is %d", sizeof(t));
return 0;
}
$ gcc struct.c ;./a
struct t size is 16
$ gcc struct.c -fpack-struct ;./a
struct t size is 14
I am currently trying to find methods of lowering memory use and cpu use in my base, I have done allot of work to keep it low and I was wondering if there are any methods, or tricks that can aid in lowering the overall usage of the mud, whether it be ways to lower the executable file-size, or methods of handling loops that will keep their use down.
I've gone about making it so that specific files get access to certain headerfiles from the system, as to not load headers that are not needed, and this helped cut my executable size down, however my cpu usage and mem-usage stay static and higher then i'd like to see.
So if anyone has idea's of how to keep memory usage down, and cpu usage down. please let me know.
My mud is C++ if that is any help :)