Merge pull request #975 from Qartar/ruby

Add windows container sizes to ruby codegen
develop
Lethosor 2016-08-07 16:31:08 -04:00 committed by GitHub
commit 72900fdfae
1 changed files with 5 additions and 7 deletions

@ -716,10 +716,8 @@ sub sizeof {
my $subtype = $field->getAttribute('ld:subtype'); my $subtype = $field->getAttribute('ld:subtype');
if ($subtype eq 'stl-vector') { if ($subtype eq 'stl-vector') {
if ($os eq 'linux') { if ($os eq 'linux' or $os eq 'windows') {
return ($arch == 64) ? 24 : 12; return ($arch == 64) ? 24 : 12;
} elsif ($os eq 'windows') {
return ($arch == 64) ? 32 : 16; # TODO: fix on x64
} else { } else {
print "sizeof stl-vector on $os\n"; print "sizeof stl-vector on $os\n";
} }
@ -727,7 +725,7 @@ sub sizeof {
if ($os eq 'linux') { if ($os eq 'linux') {
return ($arch == 64) ? 40 : 20; return ($arch == 64) ? 40 : 20;
} elsif ($os eq 'windows') { } elsif ($os eq 'windows') {
return ($arch == 64) ? 40 : 20; # TODO: fix on x64 return ($arch == 64) ? 32 : 16;
} else { } else {
print "sizeof stl-bit-vector on $os\n"; print "sizeof stl-bit-vector on $os\n";
} }
@ -735,7 +733,7 @@ sub sizeof {
if ($os eq 'linux') { if ($os eq 'linux') {
return ($arch == 64) ? 80 : 40; return ($arch == 64) ? 80 : 40;
} elsif ($os eq 'windows') { } elsif ($os eq 'windows') {
return ($arch == 64) ? 48 : 24; # TODO: fix on x64 return ($arch == 64) ? 40 : 20;
} else { } else {
print "sizeof stl-deque on $os\n"; print "sizeof stl-deque on $os\n";
} }
@ -758,7 +756,7 @@ sub sizeof {
if ($os eq 'linux') { if ($os eq 'linux') {
return ($arch == 64) ? 8 : 4; return ($arch == 64) ? 8 : 4;
} elsif ($os eq 'windows') { } elsif ($os eq 'windows') {
return 28; # TODO: fix on x64 return ($arch == 64) ? 32 : 24;
} else { } else {
print "sizeof stl-string on $os\n"; print "sizeof stl-string on $os\n";
} }
@ -767,7 +765,7 @@ sub sizeof {
if ($os eq 'linux') { if ($os eq 'linux') {
return 284; # TODO: fix on x64 return 284; # TODO: fix on x64
} elsif ($os eq 'windows') { } elsif ($os eq 'windows') {
return 184; # TODO: fix on x64 return ($arch == 64) ? 280 : 192;
} else { } else {
print "sizeof stl-fstream on $os\n"; print "sizeof stl-fstream on $os\n";
} }