Issue information

Issue ID
#4972
Status
Fixed
Severity
Medium
Started
Hercules Elf Bot
Jun 22, 2011 22:18
Last Post
Hercules Elf Bot
Apr 5, 2012 10:29
Confirmation
N/A

Hercules Elf Bot - Jun 22, 2011 22:18

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4972

CODE
struct s_skill {
    unsigned short id;
    unsigned short lv;
    unsigned short flag; // see enum e_skill_flag
};

The 'lv' member variable supports levels up to 65535 ('flag' too, in its own way). This struct is used in s_homunculus (16x), but more importantly, in mmo_charstatus (2536x). If the level tolerance was shrunk to 255, unsigned char could be used here, which would let the compiler reduce the entire structure size from 6 to 4 bytes. A quick test says that on a default setup, this would shave off 5kB, or about 13% of sizeof(mmo_charstatus), per player. This would allow larger storage/registry arrays, or a smaller memory footprint.

Hercules Elf Bot - Dec 6, 2011 4:54

Originally posted by [b]Ind[/b]
not only can, it should!

Hercules Elf Bot - Dec 22, 2011 18:29

Originally posted by [b]xazax[/b]
Fixed in [rev=15215].

This post has been edited by Brian on Mar 15, 2012 19:25