* EnvironmentVariableHolder: reduce the size of template instantiation.
Move almost all destruction logic to EnvironmentVariableHolderBase::UnregisterAndDestroy.
Specialized templates have DestructDispatchNoLock instead that can either destroy the held value,
or the holder itself.
UnregisterAndDestroy has been moved to the cpp file.
All of these changes reduce the profile build time and size on linux
Here, the size of bin/profile goes down by ~200MB.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Requested changes/fixups.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Use scoped_lock to simplify mutex management.
Updated comments.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Hopefully a fix for env variables released at a wrong time
Conditional was using incorrect variable
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Comment fixup
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Missing negation in conditional
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Cleanup the internal logic in UnregisterAndDestroy
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
AZ::Internal::EnvironmentInterface*m_environmentOwner;///< Used to know which environment we should use to free the variable if we can't transfer ownership
void*m_moduleOwner;///< Used when the variable can't transfered across module and we need to destruct the variable when the module is going away
boolm_canTransferOwnership;///< True if variable can be allocated in one module and freed in other. Usually true for POD types when they share allocator.