Skip to content

Commit de251a0

Browse files
[arccore,collections] Ajoute constructeur de 'SharedArray' prenant 'MemoryAllocationOptions' comme argument.
1 parent c766481 commit de251a0

File tree

1 file changed

+26
-14
lines changed
  • arccore/src/collections/arccore/collections

1 file changed

+26
-14
lines changed

arccore/src/collections/arccore/collections/Array.h

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,18 +1599,24 @@ class SharedArray
15991599
inline SharedArray(const UniqueArray<T>& rhs);
16001600

16011601
/*!
1602-
* \brief Créé un tableau de \a asize éléments avec un
1603-
* allocateur spécifique \a allocator.
1604-
*
1605-
* Si ArrayTraits<T>::IsPODType vaut TrueType, les éléments ne sont pas
1606-
* initialisés. Sinon, c'est le constructeur par défaut de T qui est utilisé.
1602+
* \brief Créé un tableau vide avec un allocateur spécifique \a allocator.
16071603
*
16081604
* \warning Using specific allocator for SharedArray is experimental
16091605
*/
16101606
explicit SharedArray(IMemoryAllocator* allocator)
1607+
: SharedArray(MemoryAllocationOptions(allocator))
1608+
{
1609+
}
1610+
1611+
/*!
1612+
* \brief Créé un tableau vide avec un allocateur spécifique \a allocation_options.
1613+
*
1614+
* \warning Using specific allocator for SharedArray is experimental
1615+
*/
1616+
explicit SharedArray(const MemoryAllocationOptions& allocation_options)
16111617
: Array<T>()
16121618
{
1613-
this->_initFromAllocator(allocator,0);
1619+
this->_initFromAllocator(allocation_options,0);
16141620
this->_checkValidSharedArray();
16151621
}
16161622

@@ -1620,22 +1626,28 @@ class SharedArray
16201626
*
16211627
* Si ArrayTraits<T>::IsPODType vaut TrueType, les éléments ne sont pas
16221628
* initialisés. Sinon, c'est le constructeur par défaut de T qui est utilisé.
1623-
*
1624-
* \warning Using specific allocator for SharedArray is experimental
16251629
*/
16261630
SharedArray(IMemoryAllocator* allocator,Int64 asize)
1627-
: Array<T>()
1631+
: SharedArray(MemoryAllocationOptions(allocator), asize)
16281632
{
1629-
this->_initFromAllocator(allocator,asize);
1630-
this->_resize(asize);
1631-
this->_checkValidSharedArray();
16321633
}
16331634

16341635
/*!
1635-
* \brief Créé un tableau avec l'allocateur \a allocator en recopiant les valeurs \a rhs.
1636+
* \brief Créé un tableau de \a asize éléments avec un
1637+
* allocateur spécifique \a allocator.
16361638
*
1637-
* \warning Using specific allocator for SharedArray is experimental
1639+
* Si ArrayTraits<T>::IsPODType vaut TrueType, les éléments ne sont pas
1640+
* initialisés. Sinon, c'est le constructeur par défaut de T qui est utilisé.
16381641
*/
1642+
SharedArray(const MemoryAllocationOptions& allocation_options, Int64 asize)
1643+
: Array<T>()
1644+
{
1645+
this->_initFromAllocator(allocation_options, asize);
1646+
this->_resize(asize);
1647+
this->_checkValidSharedArray();
1648+
}
1649+
1650+
//!Créé un tableau avec l'allocateur \a allocator en recopiant les valeurs \a rhs.
16391651
SharedArray(IMemoryAllocator* allocator,Span<const T> rhs)
16401652
{
16411653
this->_initFromAllocator(allocator,0);

0 commit comments

Comments
 (0)