Browse Source

Add `FreeN()` set of methods

core_refactor
Anton Tarasenko 2 years ago
parent
commit
21a60482d5
  1. 113
      sources/BaseRealm/API/Memory/MemoryAPI.uc

113
sources/BaseRealm/API/Memory/MemoryAPI.uc

@ -167,11 +167,11 @@ public function AcediaObject AllocateByReference_S(
return Allocate(class<AcediaObject>(classToAllocate), forceNewInstance); return Allocate(class<AcediaObject>(classToAllocate), forceNewInstance);
} }
/// Releases one reference to a given `AcediaObject`, calling its finalizers in case all references /// Releases one reference to a given [`AcediaObject`], calling its finalizers in case
/// were released. /// all references were released.
/// ///
/// Method will attempt to store `objectToRelease` in its object pool once deallocated, unless it is /// Method will attempt to store [`objectToRelease`] in its object pool once deallocated,
/// forbidden by its class' settings. /// unless it is forbidden by its class' settings.
public function Free(AcediaObject objectToRelease) { public function Free(AcediaObject objectToRelease) {
local AcediaObjectPool relevantPool; local AcediaObjectPool relevantPool;
@ -189,6 +189,111 @@ public function Free(AcediaObject objectToRelease) {
} }
} }
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free2(AcediaObject objectToRelease1, AcediaObject objectToRelease2) {
Free(objectToRelease1);
Free(objectToRelease2);
}
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free3(
AcediaObject objectToRelease1,
AcediaObject objectToRelease2,
AcediaObject objectToRelease3
) {
Free(objectToRelease1);
Free(objectToRelease2);
Free(objectToRelease3);
}
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free4(
AcediaObject objectToRelease1,
AcediaObject objectToRelease2,
AcediaObject objectToRelease3,
AcediaObject objectToRelease4
) {
Free(objectToRelease1);
Free(objectToRelease2);
Free(objectToRelease3);
Free(objectToRelease4);
}
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free5(
AcediaObject objectToRelease1,
AcediaObject objectToRelease2,
AcediaObject objectToRelease3,
AcediaObject objectToRelease4,
AcediaObject objectToRelease5
) {
Free(objectToRelease1);
Free(objectToRelease2);
Free(objectToRelease3);
Free(objectToRelease4);
Free(objectToRelease5);
}
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free6(
AcediaObject objectToRelease1,
AcediaObject objectToRelease2,
AcediaObject objectToRelease3,
AcediaObject objectToRelease4,
AcediaObject objectToRelease5,
AcediaObject objectToRelease6
) {
Free(objectToRelease1);
Free(objectToRelease2);
Free(objectToRelease3);
Free(objectToRelease4);
Free(objectToRelease5);
Free(objectToRelease6);
}
/// Releases references to given [`AcediaObject`]s, calling their finalizers in case
/// all references were released.
///
/// Method will attempt to store released objects in its object pool once deallocated,
/// unless it is forbidden by its class' settings.
public function Free7(
AcediaObject objectToRelease1,
AcediaObject objectToRelease2,
AcediaObject objectToRelease3,
AcediaObject objectToRelease4,
AcediaObject objectToRelease5,
AcediaObject objectToRelease6,
AcediaObject objectToRelease7
) {
Free(objectToRelease1);
Free(objectToRelease2);
Free(objectToRelease3);
Free(objectToRelease4);
Free(objectToRelease5);
Free(objectToRelease6);
Free(objectToRelease7);
}
/// Releases one reference for each `AcediaObject` inside the given array `objectsToRelease`, /// Releases one reference for each `AcediaObject` inside the given array `objectsToRelease`,
/// calling finalizers for the ones that got all of their references released. /// calling finalizers for the ones that got all of their references released.
/// ///

Loading…
Cancel
Save