From: Gabriel Corona Date: Mon, 11 Jul 2016 11:56:25 +0000 (+0200) Subject: [xbt] Remove useless bits X-Git-Tag: v3_14~777 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c69057bd07befcfb1fafa975dc9d4e76889c82cd [xbt] Remove useless bits --- diff --git a/include/xbt/automaton.h b/include/xbt/automaton.h index 90af851f0b..6b8be48537 100644 --- a/include/xbt/automaton.h +++ b/include/xbt/automaton.h @@ -115,15 +115,4 @@ XBT_PUBLIC(void) xbt_automaton_free(xbt_automaton_t a); SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_automaton_t a) - { - xbt_automaton_free(a); - } -} -} -#endif - #endif diff --git a/include/xbt/dict.h b/include/xbt/dict.h index 6a5e9126c5..87c70ec12f 100644 --- a/include/xbt/dict.h +++ b/include/xbt/dict.h @@ -174,15 +174,4 @@ xbt_dict_foreach(head, cursor, key, data) { SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_dict_t d) - { - xbt_dict_free(&d); - } -} -} -#endif - #endif /* _XBT_DICT_H */ diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 83621209fa..b8cfbdd336 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -258,15 +258,4 @@ xbt_dynar_foreach (dyn,cpt,str) { /** @} */ SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_dynar_t s) - { - xbt_dynar_free(&s); - } -} -} -#endif - #endif /* _XBT_DYNAR_H */ diff --git a/include/xbt/dynar.hpp b/include/xbt/dynar.hpp index 2129007223..77bb871fdf 100644 --- a/include/xbt/dynar.hpp +++ b/include/xbt/dynar.hpp @@ -40,14 +40,6 @@ xbt_dynar_t newDeleteDynar() [](void* p) { delete *(T**)p; }); } -/** Dynar of `T*` which `destroy()` its values */ -template inline -xbt_dynar_t newDestroyDynar() -{ - return xbt_dynar_new(sizeof(T*), - [](void* p) { simgrid::xbt::destroy(*(T**)p); }); -} - } } #endif diff --git a/include/xbt/fifo.h b/include/xbt/fifo.h index 61879ca48a..c373926d1f 100644 --- a/include/xbt/fifo.h +++ b/include/xbt/fifo.h @@ -111,15 +111,4 @@ XBT_PUBLIC(xbt_fifo_item_t) xbt_fifo_getPrevItem(xbt_fifo_item_t i); SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_fifo_t f) - { - xbt_fifo_free(f); - } -} -} -#endif - #endif /* _XBT_FIFO_H */ diff --git a/include/xbt/heap.h b/include/xbt/heap.h index 8ab575331d..ddf76dd8b4 100644 --- a/include/xbt/heap.h +++ b/include/xbt/heap.h @@ -37,15 +37,4 @@ XBT_PUBLIC(void ) xbt_heap_update(xbt_heap_t H, int i, double key); /* @} */ SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_heap_t h) - { - xbt_heap_free(h); - } -} -} -#endif - #endif /* _XBT_HEAP_H */ diff --git a/include/xbt/lib.h b/include/xbt/lib.h index 5e10edd13f..15553e30a0 100644 --- a/include/xbt/lib.h +++ b/include/xbt/lib.h @@ -77,15 +77,4 @@ XBT_PUBLIC(void) xbt_lib_remove(xbt_lib_t lib, const char *key); SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_lib_t l) - { - xbt_lib_free(&l); - } -} -} -#endif - #endif /* _XBT_LIB_H */ diff --git a/include/xbt/memory.hpp b/include/xbt/memory.hpp index ac71407975..3673943d4e 100644 --- a/include/xbt/memory.hpp +++ b/include/xbt/memory.hpp @@ -12,22 +12,6 @@ namespace simgrid { namespace xbt { -/** Delete operator which call a `destroy()` free function */ -template -struct destroy_delete { - void operator()(T* t) const - { - destroy(t); - } -}; - -/** A `unique_ptr` which works for SimGrid C types (dynar, swag, automaton, etc.) - * - * It uses an overloaded `destroy()` function to delete the object. - */ -template -using unique_ptr = std::unique_ptr >; - } } diff --git a/include/xbt/parmap.h b/include/xbt/parmap.h index e9eb7ca118..15257b55e6 100644 --- a/include/xbt/parmap.h +++ b/include/xbt/parmap.h @@ -48,15 +48,4 @@ XBT_PUBLIC(void*) xbt_parmap_next(xbt_parmap_t parmap); SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_parmap_t p) - { - xbt_parmap_destroy(p); - } -} -} -#endif - #endif diff --git a/include/xbt/swag.h b/include/xbt/swag.h index 2431b3088c..ecbdb15c46 100644 --- a/include/xbt/swag.h +++ b/include/xbt/swag.h @@ -193,15 +193,4 @@ static inline void *xbt_swag_getFirst(xbt_swag_t swag) SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { - inline void destroy(xbt_swag_t s) - { - xbt_swag_free(s); - } -} -} -#endif - #endif /* _XBT_SWAG_H */