Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make pointer parameter const.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 20 Nov 2020 14:41:44 +0000 (15:41 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 20 Nov 2020 14:41:44 +0000 (15:41 +0100)
include/smpi/smpi.h
src/smpi/internals/smpi_shared.cpp

index ec4b56d..1bfbc62 100644 (file)
@@ -1031,7 +1031,7 @@ XBT_PUBLIC void smpi_trace_set_call_location__(const char* file, const int* line
 #define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; )
 XBT_PUBLIC void* smpi_shared_malloc(size_t size, const char* file, int line);
 #define SMPI_SHARED_MALLOC(size) smpi_shared_malloc((size), __FILE__, __LINE__)
-XBT_PUBLIC void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks);
+XBT_PUBLIC void* smpi_shared_malloc_partial(size_t size, const size_t* shared_block_offsets, int nb_shared_blocks);
 #define SMPI_PARTIAL_SHARED_MALLOC(size, shared_block_offsets, nb_shared_blocks)                                       \
   smpi_shared_malloc_partial((size), (shared_block_offsets), (nb_shared_blocks))
 
index 766ee46..50be4ae 100644 (file)
@@ -155,7 +155,7 @@ constexpr unsigned HUGE_PAGE_SIZE = 1U << 21;
  * The others are not.
  */
 
-void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks)
+void* smpi_shared_malloc_partial(size_t size, const size_t* shared_block_offsets, int nb_shared_blocks)
 {
   std::string huge_page_mount_point = simgrid::config::get_value<std::string>("smpi/shared-malloc-hugepage");
   bool use_huge_page                = not huge_page_mount_point.empty();