summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc45a32)
raw | patch | inline | side by side (parent: fc45a32)
author | Yves Mettier <ymettier@free.fr> | |
Wed, 3 Oct 2012 09:27:46 +0000 (11:27 +0200) | ||
committer | Yves Mettier <ymettier@free.fr> | |
Wed, 3 Oct 2012 09:27:46 +0000 (11:27 +0200) |
variable. So its names becomes uppercase.
src/utils_cache.c | patch | blob | history |
diff --git a/src/utils_cache.c b/src/utils_cache.c
index 1c0815a9058edba316465fff23d8da80e75e4778..c4be5ad12a6720fb8573ff443b91cd405aaf618f 100644 (file)
--- a/src/utils_cache.c
+++ b/src/utils_cache.c
* Because realloc is time consuming, it's better to
* realloc by blocks and not by units.
* To see the difference, set this value to 1.
+ *
+ * To change this value at compile time:
+ * ./configure CFLAGS="-DLISTVAL_INCREASE=102400"
*/
- #define size_increment 102400
+#ifndef LISTVAL_INCREASE
+# define LISTVAL_INCREASE 1024
+#endif
int status = 0;
cdtime_t *tmp_times;
if(number <= size_arrays) {
- tmp_times = (cdtime_t *) realloc (times, sizeof (cdtime_t) * (size_arrays + size_increment));
+ tmp_times = (cdtime_t *) realloc (times, sizeof (cdtime_t) * (size_arrays + LISTVAL_INCREASE));
if (tmp_times == NULL)
{
status = -1;
@@ -614,14 +619,14 @@ int uc_get_names (char ***ret_names, cdtime_t **ret_times, size_t *ret_number)
}
if(number <= size_arrays) {
- temp = (char **) realloc (names, sizeof (char *) * (size_arrays + size_increment));
+ temp = (char **) realloc (names, sizeof (char *) * (size_arrays + LISTVAL_INCREASE));
if (temp == NULL)
{
status = -1;
break;
}
names = temp;
- size_arrays += size_increment;
+ size_arrays += LISTVAL_INCREASE;
}
names[number] = strdup (key);
if (names[number] == NULL)