Inline the free function.
This commit is contained in:
parent
0278d786a9
commit
ca0a691020
@ -26,8 +26,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#include <ctime>
|
||||
#include <cstdlib>
|
||||
#else
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -138,7 +140,9 @@ struct message *NeoComm_get_next_message(const char *channel_name);
|
||||
*
|
||||
* @param msg The message to free from memory.
|
||||
*/
|
||||
void NeoComm_free_message(struct message *msg);
|
||||
static inline void NeoComm_free_message(struct message *msg) {
|
||||
free(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a message to a channel.
|
||||
|
@ -99,10 +99,6 @@ struct message *NeoComm_get_next_message(const char *channel_name) {
|
||||
return msg;
|
||||
}
|
||||
|
||||
void NeoComm_free_message(struct message *msg) {
|
||||
free(msg);
|
||||
}
|
||||
|
||||
time_t NeoComm_send_message(const char *channel_name, const char *message) {
|
||||
if(not node.isRunning())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user