Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in names of some IMemoryAllocator methods #1804

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions arccore/src/collections/arccore/collections/IMemoryAllocator.h
Original file line number Diff line number Diff line change
@@ -117,6 +117,14 @@
*
* S'il n'y a aucune garantie, retourne 0.
*/
virtual size_t guaranteedAlignment(MemoryAllocationArgs args) const;

/*!
* \brief Valeur de l'alignement garanti par l'allocateur.
*
* \sa guaranteedAlignment()
*/
ARCCORE_DEPRECATED_REASON("Y2024: Use guaranteedAlignment() instead")
virtual size_t guarantedAlignment(MemoryAllocationArgs args) const;

/*!
@@ -140,7 +148,7 @@
virtual void copyMemory(MemoryAllocationArgs args, AllocatedMemoryInfo destination, AllocatedMemoryInfo source);

//! Ressource mémoire fournie par l'allocateur
virtual eMemoryResource memoryRessource() const { return eMemoryResource::Unknown; }
virtual eMemoryResource memoryResource() const { return eMemoryResource::Unknown; }

Check warning on line 151 in arccore/src/collections/arccore/collections/IMemoryAllocator.h

Codecov / codecov/patch

arccore/src/collections/arccore/collections/IMemoryAllocator.h#L151

Added line #L151 was not covered by tests

public:

@@ -157,7 +165,7 @@
virtual void deallocate(void* ptr) = 0;
ARCCORE_DEPRECATED_REASON("Y2023: use adjustedCapacity(MemoryAllocationArgs,Int64,Int64) instead")
virtual size_t adjustCapacity(size_t wanted_capacity, size_t element_size) = 0;
ARCCORE_DEPRECATED_REASON("Y2023: use guarantedAlignment(MemoryAllocationArgs) instead")
ARCCORE_DEPRECATED_REASON("Y2023: use guaranteedAlignment(MemoryAllocationArgs) instead")
virtual size_t guarantedAlignment() = 0;
};

@@ -278,6 +286,7 @@
void deallocate(void* ptr) override;
size_t adjustCapacity(size_t wanted_capacity, size_t element_size) override;
size_t guarantedAlignment() override { return 0; }
eMemoryResource memoryResource() const override { return eMemoryResource::Host; }

Check warning on line 289 in arccore/src/collections/arccore/collections/IMemoryAllocator.h

Codecov / codecov/patch

arccore/src/collections/arccore/collections/IMemoryAllocator.h#L289

Added line #L289 was not covered by tests
};

/*---------------------------------------------------------------------------*/
@@ -313,6 +322,7 @@
void deallocate(MemoryAllocationArgs, AllocatedMemoryInfo ptr) override;
Int64 adjustedCapacity(MemoryAllocationArgs, Int64 wanted_capacity, Int64 element_size) const override;
size_t guarantedAlignment(MemoryAllocationArgs) const override { return 0; }
eMemoryResource memoryResource() const override { return eMemoryResource::Host; }

Check warning on line 325 in arccore/src/collections/arccore/collections/IMemoryAllocator.h

Codecov / codecov/patch

arccore/src/collections/arccore/collections/IMemoryAllocator.h#L325

Added line #L325 was not covered by tests
};

/*---------------------------------------------------------------------------*/
@@ -407,6 +417,7 @@
void deallocate(void* ptr) override;
size_t adjustCapacity(size_t wanted_capacity, size_t element_size) override;
size_t guarantedAlignment() override { return m_alignment; }
eMemoryResource memoryResource() const override { return eMemoryResource::Host; }

Check warning on line 420 in arccore/src/collections/arccore/collections/IMemoryAllocator.h

Codecov / codecov/patch

arccore/src/collections/arccore/collections/IMemoryAllocator.h#L420

Added line #L420 was not covered by tests

private:

@@ -494,6 +505,7 @@
void deallocate(MemoryAllocationArgs args, AllocatedMemoryInfo ptr) override;
Int64 adjustedCapacity(MemoryAllocationArgs args, Int64 wanted_capacity, Int64 element_size) const override;
size_t guarantedAlignment(MemoryAllocationArgs) const override { return m_alignment; }
eMemoryResource memoryResource() const override { return eMemoryResource::Host; }

Check warning on line 508 in arccore/src/collections/arccore/collections/IMemoryAllocator.h

Codecov / codecov/patch

arccore/src/collections/arccore/collections/IMemoryAllocator.h#L508

Added line #L508 was not covered by tests

private:

13 changes: 11 additions & 2 deletions arccore/src/collections/arccore/collections/MemoryAllocator.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* MemoryAllocator.cc (C) 2000-2023 */
/* MemoryAllocator.cc (C) 2000-2024 */
/* */
/* Allocateurs mémoires. */
/*---------------------------------------------------------------------------*/
@@ -441,6 +441,15 @@
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

size_t IMemoryAllocator::

Check warning on line 444 in arccore/src/collections/arccore/collections/MemoryAllocator.cc

Codecov / codecov/patch

arccore/src/collections/arccore/collections/MemoryAllocator.cc#L444

Added line #L444 was not covered by tests
guaranteedAlignment(MemoryAllocationArgs args) const
{
return guarantedAlignment(args);

Check warning on line 447 in arccore/src/collections/arccore/collections/MemoryAllocator.cc

Codecov / codecov/patch

arccore/src/collections/arccore/collections/MemoryAllocator.cc#L447

Added line #L447 was not covered by tests
}

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

bool IMemoryAllocator3::
hasRealloc() const
{
2 changes: 1 addition & 1 deletion arccore/src/collections/tests/TestArray.cc
Original file line number Diff line number Diff line change
@@ -897,7 +897,7 @@
size_t guarantedAlignment(MemoryAllocationArgs args) const override
{
_checkValid(args);
return m_default_allocator.guarantedAlignment(args);
return m_default_allocator.guaranteedAlignment(args);

Check warning on line 900 in arccore/src/collections/tests/TestArray.cc

Codecov / codecov/patch

arccore/src/collections/tests/TestArray.cc#L900

Added line #L900 was not covered by tests
}

void notifyMemoryArgsChanged(MemoryAllocationArgs old_args, MemoryAllocationArgs new_args, AllocatedMemoryInfo ptr) override