refactor: avoid tr_new(), tr_free() in tr_variant (#3663)

* refactor: remove unused tr_renew()

* refactor: remove unused tr_realloc()

* refactor: avoid tr_strvDup() in tr-quark
This commit is contained in:
Charles Kerr
2022-08-17 14:44:18 -05:00
committed by GitHub
parent 9374e332ec
commit 7fe2cf68b9
4 changed files with 10 additions and 24 deletions

View File

@@ -128,9 +128,6 @@ void* tr_malloc(size_t size);
/** @brief Portability wrapper around calloc() in which `0' is a safe argument */
void* tr_malloc0(size_t size);
/** @brief Portability wrapper around reallocf() in which `0' is a safe argument */
void* tr_realloc(void* p, size_t size);
/** @brief Portability wrapper around free() in which `nullptr' is a safe argument */
void tr_free(void* p);
@@ -138,9 +135,6 @@ void tr_free(void* p);
#define tr_new0(struct_type, n_structs) (static_cast<struct_type*>(tr_malloc0(sizeof(struct_type) * (size_t)(n_structs))))
#define tr_renew(struct_type, mem, n_structs) \
(static_cast<struct_type*>(tr_realloc((mem), sizeof(struct_type) * (size_t)(n_structs))))
constexpr bool tr_str_is_empty(char const* value)
{
return value == nullptr || *value == '\0';