Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba4019d

Browse files
authored
Merge pull request HaxeFoundation#858 from RobDangerous/master
Add write barriers to fixed anon constructors
2 parents e378c13 + b1ea074 commit ba4019d

1 file changed

Lines changed: 47 additions & 2 deletions

File tree

include/hx/Anon.h

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Anon_obj : public hx::Object
8181
fixed->key = inName;
8282
fixed->value = inValue;
8383
if (inValue.type == ::cpp::Variant::typeObject) {
84-
HX_OBJ_WB_GET(this, hx::PointerOf(inValue.valObject));
84+
HX_OBJ_WB_GET(this, inValue.valObject);
8585
}
8686
else if (inValue.type == ::cpp::Variant::typeString) {
87-
HX_OBJ_WB_GET(this, hx::PointerOf(inValue.valStringPtr));
87+
HX_OBJ_WB_GET(this, inValue.valStringPtr);
8888
}
8989
return this;
9090
}
@@ -163,6 +163,9 @@ class AnonStruct1_obj : public hx::Object
163163
{
164164
AnonStruct1_obj *result = new AnonStruct1_obj;
165165
result->name0 = inName0; result->t0 = inT0;
166+
if (hx::ContainsPointers<_hx_T0>()) {
167+
HX_OBJ_WB_GET(result, hx::PointerOf(inT0));
168+
}
166169
return result;
167170
}
168171
hx::Val __Field(const String &inField, hx::PropertyAccess)
@@ -218,7 +221,13 @@ class AnonStruct2_obj : public hx::Object
218221
{
219222
AnonStruct2_obj *result = new AnonStruct2_obj;
220223
result->name0 = inName0; result->t0 = inT0;
224+
if (hx::ContainsPointers<_hx_T0>()) {
225+
HX_OBJ_WB_GET(result, hx::PointerOf(inT0));
226+
}
221227
result->name1 = inName1; result->t1 = inT1;
228+
if (hx::ContainsPointers<_hx_T1>()) {
229+
HX_OBJ_WB_GET(result, hx::PointerOf(inT1));
230+
}
222231
return result;
223232
}
224233
hx::Val __Field(const String &inField, hx::PropertyAccess)
@@ -288,8 +297,17 @@ class AnonStruct3_obj : public hx::Object
288297
{
289298
AnonStruct3_obj *result = new AnonStruct3_obj;
290299
result->name0 = inName0; result->t0 = inT0;
300+
if (hx::ContainsPointers<_hx_T0>()) {
301+
HX_OBJ_WB_GET(result, hx::PointerOf(inT0));
302+
}
291303
result->name1 = inName1; result->t1 = inT1;
304+
if (hx::ContainsPointers<_hx_T1>()) {
305+
HX_OBJ_WB_GET(result, hx::PointerOf(inT1));
306+
}
292307
result->name2 = inName2; result->t2 = inT2;
308+
if (hx::ContainsPointers<_hx_T2>()) {
309+
HX_OBJ_WB_GET(result, hx::PointerOf(inT2));
310+
}
293311
return result;
294312
}
295313
hx::Val __Field(const String &inField, hx::PropertyAccess)
@@ -371,9 +389,21 @@ class AnonStruct4_obj : public hx::Object
371389
{
372390
AnonStruct4_obj *result = new AnonStruct4_obj;
373391
result->name0 = inName0; result->t0 = inT0;
392+
if (hx::ContainsPointers<_hx_T0>()) {
393+
HX_OBJ_WB_GET(result, hx::PointerOf(inT0));
394+
}
374395
result->name1 = inName1; result->t1 = inT1;
396+
if (hx::ContainsPointers<_hx_T1>()) {
397+
HX_OBJ_WB_GET(result, hx::PointerOf(inT1));
398+
}
375399
result->name2 = inName2; result->t2 = inT2;
400+
if (hx::ContainsPointers<_hx_T2>()) {
401+
HX_OBJ_WB_GET(result, hx::PointerOf(inT2));
402+
}
376403
result->name3 = inName3; result->t3 = inT3;
404+
if (hx::ContainsPointers<_hx_T3>()) {
405+
HX_OBJ_WB_GET(result, hx::PointerOf(inT3));
406+
}
377407
return result;
378408
}
379409
hx::Val __Field(const String &inField, hx::PropertyAccess)
@@ -470,10 +500,25 @@ class AnonStruct5_obj : public hx::Object
470500
{
471501
AnonStruct5_obj *result = new AnonStruct5_obj;
472502
result->name0 = inName0; result->t0 = inT0;
503+
if (hx::ContainsPointers<_hx_T0>()) {
504+
HX_OBJ_WB_GET(result, hx::PointerOf(inT0));
505+
}
473506
result->name1 = inName1; result->t1 = inT1;
507+
if (hx::ContainsPointers<_hx_T1>()) {
508+
HX_OBJ_WB_GET(result, hx::PointerOf(inT1));
509+
}
474510
result->name2 = inName2; result->t2 = inT2;
511+
if (hx::ContainsPointers<_hx_T2>()) {
512+
HX_OBJ_WB_GET(result, hx::PointerOf(inT2));
513+
}
475514
result->name3 = inName3; result->t3 = inT3;
515+
if (hx::ContainsPointers<_hx_T3>()) {
516+
HX_OBJ_WB_GET(result, hx::PointerOf(inT3));
517+
}
476518
result->name4 = inName4; result->t4 = inT4;
519+
if (hx::ContainsPointers<_hx_T4>()) {
520+
HX_OBJ_WB_GET(result, hx::PointerOf(inT4));
521+
}
477522
return result;
478523
}
479524
hx::Val __Field(const String &inField, hx::PropertyAccess)

0 commit comments

Comments
 (0)