[core] mark some data_* funcs cold

mark funcs cold if seldom used or used only at startup config processing

mark most data_config_* funcs cold

data_*_copy()
data_*_insert_dup()
data_*_print()
data_*_reset()

array_reset()
This commit is contained in:
Glenn Strauss 2019-10-02 02:16:08 -04:00
parent b2991c686d
commit 70b5d729ae
5 changed files with 22 additions and 0 deletions

View File

@ -58,8 +58,13 @@ typedef struct {
data_integer *data_integer_init(void);
array *array_init(void);
__attribute_cold__
array *array_init_array(const array *a);
void array_free(array *a);
__attribute_cold__
void array_reset(array *a);
__attribute_hot__

View File

@ -5,6 +5,7 @@
#include <string.h>
#include <stdlib.h>
__attribute_cold__
static data_unset *data_array_copy(const data_unset *s) {
data_array *src = (data_array *)s;
data_array *ds = data_array_init();
@ -24,6 +25,7 @@ static void data_array_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_array_reset(data_unset *d) {
data_array *ds = (data_array *)d;
@ -32,6 +34,7 @@ static void data_array_reset(data_unset *d) {
array_reset(ds->value);
}
__attribute_cold__
static int data_array_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -40,6 +43,7 @@ static int data_array_insert_dup(data_unset *dst, data_unset *src) {
return 0;
}
__attribute_cold__
static void data_array_print(const data_unset *d, int depth) {
data_array *ds = (data_array *)d;

View File

@ -12,6 +12,7 @@
#include <pcre.h>
#endif
__attribute_cold__
static data_unset *data_config_copy(const data_unset *s) {
data_config *src = (data_config *)s;
data_config *ds = data_config_init();
@ -25,6 +26,7 @@ static data_unset *data_config_copy(const data_unset *s) {
return (data_unset *)ds;
}
__attribute_cold__
static void data_config_free(data_unset *d) {
data_config *ds = (data_config *)d;
@ -45,6 +47,7 @@ static void data_config_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_config_reset(data_unset *d) {
data_config *ds = (data_config *)d;
@ -55,6 +58,7 @@ static void data_config_reset(data_unset *d) {
array_reset(ds->value);
}
__attribute_cold__
static int data_config_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -63,6 +67,7 @@ static int data_config_insert_dup(data_unset *dst, data_unset *src) {
return 0;
}
__attribute_cold__
static void data_config_print(const data_unset *d, int depth) {
data_config *ds = (data_config *)d;
array *a = (array *)ds->value;

View File

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <string.h>
__attribute_cold__
static data_unset *data_integer_copy(const data_unset *s) {
data_integer *src = (data_integer *)s;
data_integer *ds = data_integer_init();
@ -23,6 +24,7 @@ static void data_integer_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_integer_reset(data_unset *d) {
data_integer *ds = (data_integer *)d;
@ -31,6 +33,7 @@ static void data_integer_reset(data_unset *d) {
ds->value = 0;
}
__attribute_cold__
static int data_integer_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -39,6 +42,7 @@ static int data_integer_insert_dup(data_unset *dst, data_unset *src) {
return 0;
}
__attribute_cold__
static void data_integer_print(const data_unset *d, int depth) {
data_integer *ds = (data_integer *)d;
UNUSED(depth);

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
__attribute_cold__
static data_unset *data_string_copy(const data_unset *s) {
data_string *src = (data_string *)s;
data_string *ds = data_string_init();
@ -24,6 +25,7 @@ static void data_string_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_string_reset(data_unset *d) {
data_string *ds = (data_string *)d;
@ -32,6 +34,7 @@ static void data_string_reset(data_unset *d) {
buffer_reset(ds->value);
}
__attribute_cold__
static int data_string_insert_dup(data_unset *dst, data_unset *src) {
data_string *ds_dst = (data_string *)dst;
data_string *ds_src = (data_string *)src;
@ -48,6 +51,7 @@ static int data_string_insert_dup(data_unset *dst, data_unset *src) {
return 0;
}
__attribute_cold__
static void data_string_print(const data_unset *d, int depth) {
data_string *ds = (data_string *)d;
size_t i, len;