- Turned DropItem into a plain struct again like it was before the scripting branch got merged.

Making this an object had little to no advantage, except being able to remove the deleter code. Now, with some of the class data already being allocated in a memory arena so that freeing it is easier, this can also be used for the drop item lists which makes it unnecessary to subject them to the GC. This also merges the memory arenas for VM functions and flat pointers because both get deleted at the same time so they can share the same one.
This commit is contained in:
Christoph Oelckers 2017-02-08 20:37:22 +01:00
commit 8277299135
13 changed files with 30 additions and 48 deletions

View file

@ -921,7 +921,7 @@ DEFINE_PROPERTY(dropitem, S_i_i, Actor)
bag.DropItemList = NULL;
}
DDropItem *di = new DDropItem;
FDropItem *di = (FDropItem*)ClassDataAllocator.Alloc(sizeof(FDropItem));
di->Name = type;
di->Probability = 255;
@ -939,7 +939,6 @@ DEFINE_PROPERTY(dropitem, S_i_i, Actor)
}
di->Next = bag.DropItemList;
bag.DropItemList = di;
GC::WriteBarrier(di);
}
//==========================================================================
@ -2685,7 +2684,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, startitem, S_i, PlayerPawn)
bag.DropItemList = NULL;
}
DDropItem *di = new DDropItem;
FDropItem *di = (FDropItem*)ClassDataAllocator.Alloc(sizeof(FDropItem));
di->Name = str;
di->Probability = 255;
@ -2697,7 +2696,6 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, startitem, S_i, PlayerPawn)
}
di->Next = bag.DropItemList;
bag.DropItemList = di;
GC::WriteBarrier(di);
}
//==========================================================================