Hi Piotr,
Piotr Caban piotr@codeweavers.com wrote:
@@ -1316,11 +1316,19 @@ static void test_marshal_VARIANT(void) ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; check_safearray(wirev, lpsa);
- VariantInit(&v2);
- mem = CoTaskMemAlloc(1024);
- lpsa_copy = lpsa2 = SafeArrayCreate(VT_I8, 1, &sab);
- CoTaskMemFree(mem);
- mem = lpsa2->pvData;
- V_VT(&v2) = VT_UI4 | VT_ARRAY | VT_BYREF;
- V_ARRAYREF(&v2) = &lpsa2;
Looks like the result of CoTaskMemAlloc/CoTaskMemFree is not used.
Hi Dmitry,
On 01/13/16 03:47, Dmitry Timoshkov wrote:
Piotr Caban piotr@codeweavers.com wrote:
@@ -1316,11 +1316,19 @@ static void test_marshal_VARIANT(void) ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; check_safearray(wirev, lpsa);
- VariantInit(&v2);
- mem = CoTaskMemAlloc(1024);
- lpsa_copy = lpsa2 = SafeArrayCreate(VT_I8, 1, &sab);
- CoTaskMemFree(mem);
- mem = lpsa2->pvData;
- V_VT(&v2) = VT_UI4 | VT_ARRAY | VT_BYREF;
- V_ARRAYREF(&v2) = &lpsa2;
Looks like the result of CoTaskMemAlloc/CoTaskMemFree is not used.
I've added it intentionally so there's a bigger chance a different memory is allocated if safe array is reallocated (I'm trying to show that memory is reused without freeing and allocating it again). Of course there's no guarantee for that. I can remove it if it's preferable.
Thanks, Piotr
Piotr Caban piotr@codeweavers.com wrote:
@@ -1316,11 +1316,19 @@ static void test_marshal_VARIANT(void) ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; check_safearray(wirev, lpsa);
- VariantInit(&v2);
- mem = CoTaskMemAlloc(1024);
- lpsa_copy = lpsa2 = SafeArrayCreate(VT_I8, 1, &sab);
- CoTaskMemFree(mem);
- mem = lpsa2->pvData;
- V_VT(&v2) = VT_UI4 | VT_ARRAY | VT_BYREF;
- V_ARRAYREF(&v2) = &lpsa2;
Looks like the result of CoTaskMemAlloc/CoTaskMemFree is not used.
I've added it intentionally so there's a bigger chance a different memory is allocated if safe array is reallocated (I'm trying to show that memory is reused without freeing and allocating it again). Of course there's no guarantee for that. I can remove it if it's preferable.
I'd suggest to add a comment about this so that noone would try to remove "dead code".
On 01/13/16 08:19, Dmitry Timoshkov wrote:
Piotr Caban piotr@codeweavers.com wrote:
@@ -1316,11 +1316,19 @@ static void test_marshal_VARIANT(void) ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; check_safearray(wirev, lpsa);
- VariantInit(&v2);
- mem = CoTaskMemAlloc(1024);
- lpsa_copy = lpsa2 = SafeArrayCreate(VT_I8, 1, &sab);
- CoTaskMemFree(mem);
- mem = lpsa2->pvData;
- V_VT(&v2) = VT_UI4 | VT_ARRAY | VT_BYREF;
- V_ARRAYREF(&v2) = &lpsa2;
Looks like the result of CoTaskMemAlloc/CoTaskMemFree is not used.
I've added it intentionally so there's a bigger chance a different memory is allocated if safe array is reallocated (I'm trying to show that memory is reused without freeing and allocating it again). Of course there's no guarantee for that. I can remove it if it's preferable.
I'd suggest to add a comment about this so that noone would try to remove "dead code".
I've sent a fixed version of the patch. I have added FADF_STATIC feature and removed no longer needed CoTaskMemAlloc call.
Thanks, Piotr