move common code file in common directory

remove several unused files
remove mem_block_t that is never used in a different way than a simple heap buffer
move up IP address type and remove duplications of the same struct declaration
This commit is contained in:
Laurent THOMAS
2023-12-19 10:37:10 +01:00
parent 790c3b999d
commit 63b64d4fce
120 changed files with 518 additions and 987 deletions
@@ -59,29 +59,6 @@ typedef struct timer_elm_s {
static int nb_queues=0;
static pthread_mutex_t lock_nb_queues;
void *pool_buffer_init (void) {
return 0;
}
void *pool_buffer_clean (void *arg) {
//-----------------------------------------------------------------------------
return 0;
}
void free_mem_block (mem_block_t *leP, const char *caller) {
AssertFatal(leP!=NULL,"");
free(leP);
}
mem_block_t *get_free_mem_block (uint32_t sizeP, const char *caller) {
mem_block_t *ptr=(mem_block_t *)malloc(sizeP+sizeof(mem_block_t));
ptr->next = NULL;
ptr->previous = NULL;
ptr->data=((unsigned char *)ptr)+sizeof(mem_block_t);
ptr->size=sizeP;
return ptr;
}
void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize_t size) {
void *ptr = NULL;
AssertFatal ((ptr=calloc (size, 1)) != NULL, "Memory allocation of %zu bytes failed (%d -> %d)!\n",
+1 -4
View File
@@ -26,9 +26,8 @@
#include <stdint.h>
#include <sys/epoll.h>
#include <mem_block.h>
#include <assertions.h>
#include "common/utils/mem/oai_memory.h"
typedef enum timer_type_s {
TIMER_PERIODIC,
@@ -62,7 +61,6 @@ typedef struct itti_lte_time_s {
uint8_t slot;
} itti_lte_time_t;
typedef struct IttiMsgEmpty_s {
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
// To be removed if the structure is filled
@@ -552,7 +550,6 @@ void itti_set_task_real_time(task_id_t task_id);
void itti_send_terminate_message(task_id_t task_id);
void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize_t size);
int memory_read(const char *datafile, void *data, size_t size);
int itti_free(task_id_t task_id, void *ptr);
int itti_init(task_id_t task_max, const task_info_t *tasks_info);