From: Arnaud Giersch Date: Tue, 29 Jan 2019 09:11:38 +0000 (+0100) Subject: Kill dead code. X-Git-Tag: v3_22~459 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a590aa18a2bb3ee49e1e0db7984f75017b7b7914 Kill dead code. This test for mallocators has never been used. --- diff --git a/teshsuite/xbt/CMakeLists.txt b/teshsuite/xbt/CMakeLists.txt index e7953d048f..d2d2501f5d 100644 --- a/teshsuite/xbt/CMakeLists.txt +++ b/teshsuite/xbt/CMakeLists.txt @@ -1,4 +1,4 @@ -foreach(x cmdline log_large log_usage mallocator) +foreach(x cmdline log_large log_usage) add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -32,7 +32,7 @@ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/log_usage/log_us ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_32.tesh PARENT_SCOPE) set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_test.cpp PARENT_SCOPE) -foreach(x cmdline log_large parallel_log_crashtest parmap_test) #mallocator parmap_bench +foreach(x cmdline log_large parallel_log_crashtest parmap_test) #parmap_bench ADD_TESH(tesh-xbt-${x} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/${x} ${x}.tesh) endforeach() diff --git a/teshsuite/xbt/mallocator/mallocator.c b/teshsuite/xbt/mallocator/mallocator.c deleted file mode 100644 index d8e3ffb5fe..0000000000 --- a/teshsuite/xbt/mallocator/mallocator.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "xbt/mallocator.h" -#include "xbt.h" - -#include /* snprintf */ - -typedef struct element { - int value; -} s_element_t; -typedef struct element *element_t; - -element_t base_mallocator; - -static void *element_mallocator_new_f(void) -{ - element_t elem = xbt_new(s_element_t, 1); - elem->value = 0; - return elem; -} - -static void element_mallocator_free_f(void *elem) -{ - xbt_free(elem); -} - -#define element_mallocator_reset_f ((void_f_pvoid_t)NULL) - -static void pprint_elems(xbt_dynar_t elems) { - unsigned int iter; - element_t elem; - printf("Elems:"); - xbt_dynar_foreach(elems, iter, elem) { - printf(" (%d,%d)", elem->value, (int)(base_mallocator-elem)/(int)sizeof(int)); - } - printf("\n"); -} - -int main(int argc, char**argv) -{ - xbt_mallocator_initialization_is_done(1); - int i = 0; - xbt_mallocator_t mallocator = - xbt_mallocator_new(65536, element_mallocator_new_f, element_mallocator_free_f, element_mallocator_reset_f); - xbt_dynar_t elems = xbt_dynar_new(sizeof(element_t), NULL); - element_t elem = NULL; - base_mallocator = xbt_mallocator_get(mallocator); - - for (i=0; i<=10; i++) { - elem = xbt_mallocator_get(mallocator); - elem->value = i; - xbt_dynar_push(elems, &elem); - } - pprint_elems(elems); - - for (i=0; i<=5; i++) { - xbt_dynar_pop(elems, &elem); - xbt_mallocator_release(mallocator, elem); - } - pprint_elems(elems); - - xbt_dynar_remove_at(elems, 2, &elem); - xbt_mallocator_release(mallocator, elem); - pprint_elems(elems); - - for (i=11; i<=15; i++) { - elem = xbt_mallocator_get(mallocator); - elem->value = i; - xbt_dynar_push(elems, &elem); - } - pprint_elems(elems); - - return 0; -} diff --git a/teshsuite/xbt/mallocator/mallocator.tesh b/teshsuite/xbt/mallocator/mallocator.tesh deleted file mode 100644 index 6eebf9a7e7..0000000000 --- a/teshsuite/xbt/mallocator/mallocator.tesh +++ /dev/null @@ -1,5 +0,0 @@ -$ ${bindir:=.}/mallocator -> Elems: (0,-2) (1,-6) (2,-8) (3,-4) (4,-14) (5,-16) (6,-18) (7,-28) (8,-30) (9,-32) (10,-34) -> Elems: (0,-2) (1,-6) (2,-8) (3,-4) (4,-14) -> Elems: (0,-2) (1,-6) (3,-4) (4,-14) -> Elems: (0,-2) (1,-6) (3,-4) (4,-14) (11,-8) (12,-16) (13,-18) (14,-28) (15,-30)