From 8664a66ec2b007a6f7dc0e0bc3d2ccba9851d09d Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 31 Jan 2022 17:15:57 +0100 Subject: [PATCH] Kill now unused xbt_dynar_shrink(). --- ChangeLog | 3 +++ docs/source/The_XBT_toolbox.rst | 1 - include/xbt/dynar.h | 1 - src/xbt/dynar.cpp | 13 ------------- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 581d490d6c..9c042acd86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ SimGrid (3.30.1) NOT RELEASED YET (v3.31 expected March 20. 2022, 15:33 UTC) +XBT: + - Drop xbt_dynar_shrink(). + ---------------------------------------------------------------------------- SimGrid (3.30) January 30. 2022. diff --git a/docs/source/The_XBT_toolbox.rst b/docs/source/The_XBT_toolbox.rst index b7ec2f717c..d4b26d7714 100644 --- a/docs/source/The_XBT_toolbox.rst +++ b/docs/source/The_XBT_toolbox.rst @@ -206,7 +206,6 @@ Creation and destruction .. doxygenfunction:: xbt_dynar_new .. doxygenfunction:: xbt_dynar_free .. doxygenfunction:: xbt_dynar_free_container -.. doxygenfunction:: xbt_dynar_shrink Dynars as regular arrays ======================== diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index ef928508b2..89d0f2f6b4 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -38,7 +38,6 @@ typedef struct xbt_dynar_s { XBT_PUBLIC xbt_dynar_t xbt_dynar_new(const unsigned long elm_size, void_f_pvoid_t free_f); XBT_PUBLIC void xbt_dynar_free(xbt_dynar_t* dynar); XBT_PUBLIC void xbt_dynar_free_container(xbt_dynar_t* dynar); -XBT_PUBLIC void xbt_dynar_shrink(xbt_dynar_t dynar, int empty_slots); /* Dynar as a regular array */ XBT_PUBLIC void xbt_dynar_get_cpy(const_xbt_dynar_t dynar, unsigned long idx, void* dst); diff --git a/src/xbt/dynar.cpp b/src/xbt/dynar.cpp index b3b8f5e728..a1c8d999ba 100644 --- a/src/xbt/dynar.cpp +++ b/src/xbt/dynar.cpp @@ -118,19 +118,6 @@ void xbt_dynar_reset(xbt_dynar_t dynar) dynar->used = 0; } -/** - * Shrinks (reduces) the dynar by removing empty slots in the internal storage to save memory. - * If @c empty_slots_wanted is not zero, this operation preserves that amount of empty slot, for fast future additions. - * Note that if @c empty_slots_wanted is large enough, the internal array is expanded instead of shrunk. - * - * @param dynar a dynar - * @param empty_slots_wanted number of empty slots elements that can be inserted the internal storage without resizing it - */ -void xbt_dynar_shrink(xbt_dynar_t dynar, int empty_slots_wanted) -{ - _xbt_dynar_resize(dynar, dynar->used + empty_slots_wanted); -} - /** @brief Destructor: kilkil a dynar and its content. */ void xbt_dynar_free(xbt_dynar_t* dynar) { -- 2.20.1