/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
- /** Creates (but don't start) a data transmission to that mailbox */
+ /** Creates (but don't start) a data transmission to that mailbox.
+ *
+ * Please note that if you send a pointer to some data, you must ensure that your data remains live during the
+ * communication, or the receiver will get a pointer to a garbled memory area.
+ */
- /** Creates and start a data transmission to that mailbox */
+ /** Creates and start a data transmission to that mailbox.
+ *
+ * Please note that if you send a pointer to some data, you must ensure that your data remains live during the
+ * communication, or the receiver will get a pointer to a garbled memory area.
+ */
CommPtr put_async(void* data, uint64_t simulated_size_in_bytes);
kernel::activity::ActivityImplPtr iprobe(int type, bool (*match_fun)(void*, void*, kernel::activity::CommImpl*),
void* data);
CommPtr put_async(void* data, uint64_t simulated_size_in_bytes);
kernel::activity::ActivityImplPtr iprobe(int type, bool (*match_fun)(void*, void*, kernel::activity::CommImpl*),
void* data);
- /** Blocking data transmission */
+ /** Blocking data transmission.
+ *
+ * Please note that if you send a pointer to some data, you must ensure that your data remains live during the
+ * communication, or the receiver will get a pointer to a garbled memory area.
+ */
void put(void* payload, uint64_t simulated_size_in_bytes);
/** Blocking data transmission with timeout */
void put(void* payload, uint64_t simulated_size_in_bytes, double timeout);
void put(void* payload, uint64_t simulated_size_in_bytes);
/** Blocking data transmission with timeout */
void put(void* payload, uint64_t simulated_size_in_bytes, double timeout);
/** Creates (but don't start) a data reception onto that mailbox */
CommPtr get_init();
/** Creates and start an async data reception to that mailbox */
/** Creates (but don't start) a data reception onto that mailbox */
CommPtr get_init();
/** Creates and start an async data reception to that mailbox */
template <typename T> std::unique_ptr<T> get_unique() { return std::unique_ptr<T>(get<T>()); }
/** Blocking data reception with timeout */
template <typename T> std::unique_ptr<T> get_unique() { return std::unique_ptr<T>(get<T>()); }
/** Blocking data reception with timeout */
-template <> CommPtr Mailbox::get_async<void>(void** data);
-template <> void* Mailbox::get<void>();
-template <> void* Mailbox::get<void>(double timeout);
-
-inline CommPtr Mailbox::get_async(void** data) // XBT_ATTRIB_DEPRECATED_v331
+template <typename T> CommPtr Mailbox::get_async(T** data)