rename xxx_create() / xxx_destory() -> xxx_new() / xxx_free()

This commit is contained in:
luwenpeng
2024-03-08 14:20:36 +08:00
parent 9d562ffee6
commit c945931620
56 changed files with 330 additions and 330 deletions

View File

@@ -91,7 +91,7 @@ static void *dumpfile_thread_cycle(void *arg)
* Public API
******************************************************************************/
struct packet_io_dumpfile *packet_io_dumpfile_create(struct packet_io_dumpfile_confg *config)
struct packet_io_dumpfile *packet_io_dumpfile_new(struct packet_io_dumpfile_confg *config)
{
pthread_t tid;
struct packet_io_dumpfile *handle = (struct packet_io_dumpfile *)calloc(1, sizeof(struct packet_io_dumpfile));
@@ -106,7 +106,7 @@ struct packet_io_dumpfile *packet_io_dumpfile_create(struct packet_io_dumpfile_c
for (uint16_t i = 0; i < handle->nr_threads; i++)
{
handle->queue[i] = packet_queue_create(MAX_PACKET_QUEUE_SIZE);
handle->queue[i] = packet_queue_new(MAX_PACKET_QUEUE_SIZE);
if (handle->queue[i] == NULL)
{
PACKET_IO_LOG_ERROR("unable to create packet queue");
@@ -123,11 +123,11 @@ struct packet_io_dumpfile *packet_io_dumpfile_create(struct packet_io_dumpfile_c
return handle;
error_out:
packet_io_dumpfile_destory(handle);
packet_io_dumpfile_free(handle);
return NULL;
}
void packet_io_dumpfile_destory(struct packet_io_dumpfile *handle)
void packet_io_dumpfile_free(struct packet_io_dumpfile *handle)
{
if (handle)
{
@@ -140,7 +140,7 @@ void packet_io_dumpfile_destory(struct packet_io_dumpfile *handle)
for (uint16_t i = 0; i < handle->nr_threads; i++)
{
packet_queue_destory(handle->queue[i]);
packet_queue_free(handle->queue[i]);
}
free(handle);
handle = NULL;