dpnet: Simplify the storing of component data

Stefan Dösinger stefandoesinger at gmail.com
Wed Jun 10 04:17:40 CDT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I am OK with this patch in principle if you believe that it is an
improvement. It reduces the code size, but on the other hand it means
that you're having tiny allocations for DWORDs and GUIDs. Keep in mind
that such allocations mean overhead in memory use, run time and memory
fragmentation.

I'd like to point out an alternative approach: You can give struct
component a variable size, similar to how struct wined3d_private_data
in include/wine/wined3d.h works.

But overall I think this is a minor detail considering the overall
state of the directplay libs and that there are more important issues
to solve. I don't want to stand in your way by arguing about small
things like this. I can't promise Alexandre agrees though.

Either way, two style comments:
The test is a good test to add, but should be in its own patch.

Am 2015-06-10 um 06:41 schrieb Alistair Leslie-Hughes:
>              found = TRUE;
>  
> -            if(entry->type == DPNA_DATATYPE_STRING_ANSI)
> -                heap_free(entry->data.ansi);
> -            else if(entry->type == DPNA_DATATYPE_STRING)
> -                heap_free(entry->data.string);
> -            else if(entry->type == DPNA_DATATYPE_BINARY)
> -                heap_free(entry->data.binary);
> +           heap_free(entry->data);
>  
>              break;
The added heap_free line is indented by 11 chars.

Cheers,
Stefan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJVeAC0AAoJEN0/YqbEcdMws9oP/RyusEIcZnV4GWTAmfaSKfFn
0iheACWwmeL3GlWeqmY51S8ImuKcoD0HoZ/vQm6jMhTTJFK3jENVJkMk/Mjx8Kk6
ZPcit6nPB184lDgzLXV0gHbMlPkFxdTPJi++1ZfKa9LskJ3zIrgF7LcJFidtCSeG
7yHdg6C0BiQH4oXjBzY+fVRzaQluKEihncaa2tYdErfMUCzUf+RAi99/tnete2Re
EiejXowzg5HcxjBHMupsGEcFocUnXtUlPzJf0UIawbptxzPYXk3H0VYPohIrLVm6
f/chcdKlvAi5xdUlCuF4nLw9TQxyC5h3mf5p7l/JdDbgRE8knCO1w/HrzOHJJJRB
TnkU5EdrnIc3Bx6Tw/kQGTKsM3SAuSapdjBsQRracNaQVzdqYKfsMPaiQeRVmdQO
LJbyeECFw3l3opf/LFd/TUguDws2hChASaBAOf25vorhD6wH8fnaoNnEh1qMtBH5
x1jJjxB+B0Uwa4nYKProoOc0Qw0/zoaVlv3vCKiiEggz+BkXEuYb58ZDysSg4A1w
JVO0S6GAfumFPWvHMtoIEPsFxiPl6xHiwXsKzrHc8K5EpUTZ2Jcv0lam53x39Tb1
cJmluv1SyxrdrTWT1nCtgg+ma8ezid8HEpOj+aIWVwYcKwR9uF09jvDEaAzwSuAr
V6ogftbNHriUDl15YrO+
=zne3
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list