add func fc_free_iovec_array

rw_perf_optimization
YuQing 2022-09-04 11:29:13 +08:00
parent b0d57b325d
commit 48ec9c64c6
2 changed files with 10 additions and 0 deletions

View File

@ -463,6 +463,7 @@ static int _realloc_buffer(struct fast_task_info *pTask, const int new_size,
const bool copy_data) const bool copy_data)
{ {
char *new_buff; char *new_buff;
new_buff = (char *)fc_malloc(new_size); new_buff = (char *)fc_malloc(new_size);
if (new_buff == NULL) if (new_buff == NULL)
{ {

View File

@ -1277,6 +1277,15 @@ static inline int fc_check_realloc_iovec_array(
return 0; return 0;
} }
static inline void fc_free_iovec_array(iovec_array_t *array)
{
if (array->iovs != NULL) {
free(array->iovs);
array->iovs = NULL;
array->alloc = 0;
}
}
static inline pid_t fc_gettid() static inline pid_t fc_gettid()
{ {
#ifdef OS_LINUX #ifdef OS_LINUX