aboutsummaryrefslogtreecommitdiff
path: root/src/initcache.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2020-11-20 16:37:12 +0100
committerKristian Evers <kristianevers@gmail.com>2020-11-20 16:40:40 +0100
commit046270a85faf20f38d01e02942d197db74bb8542 (patch)
treef95cc5511d3de0d76070553c3a0b04d71f545c0e /src/initcache.cpp
parent56f0ad70054eea15e9671cd67aafd14bf7c11c74 (diff)
downloadPROJ-046270a85faf20f38d01e02942d197db74bb8542.tar.gz
PROJ-046270a85faf20f38d01e02942d197db74bb8542.zip
Remove old pj_ memory (de)allocation functions
Gone are pj_malloc, pj_calloc, pj_dalloc and pj_dealloc. Their primary function as API memory functions in proj_api.h is no longer there and the other use as a workaround for old errno problems is no longer valid either. Replaced with malloc and free across the codebase.
Diffstat (limited to 'src/initcache.cpp')
-rw-r--r--src/initcache.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/initcache.cpp b/src/initcache.cpp
index af20fb82..cf9460ab 100644
--- a/src/initcache.cpp
+++ b/src/initcache.cpp
@@ -48,7 +48,7 @@ paralist *pj_clone_paralist( const paralist *list)
for( ; list != nullptr; list = list->next )
{
paralist *newitem = (paralist *)
- pj_malloc(sizeof(paralist) + strlen(list->param));
+ malloc(sizeof(paralist) + strlen(list->param));
newitem->used = 0;
newitem->next = nullptr;
@@ -83,17 +83,17 @@ void pj_clear_initcache()
{
paralist *n, *t = cache_paralist[i];
- pj_dalloc( cache_key[i] );
+ free( cache_key[i] );
/* free parameter list elements */
for (; t != nullptr; t = n) {
n = t->next;
- pj_dalloc(t);
+ free(t);
}
}
- pj_dalloc( cache_key );
- pj_dalloc( cache_paralist );
+ free( cache_key );
+ free( cache_paralist );
cache_count = 0;
cache_alloc= 0;
cache_key = nullptr;
@@ -151,29 +151,29 @@ void pj_insert_initcache( const char *filekey, const paralist *list )
cache_alloc = cache_alloc * 2 + 15;
- cache_key_new = (char **) pj_malloc(sizeof(char*) * cache_alloc);
+ cache_key_new = (char **) malloc(sizeof(char*) * cache_alloc);
if( cache_key && cache_count )
{
memcpy( cache_key_new, cache_key, sizeof(char*) * cache_count);
}
- pj_dalloc( cache_key );
+ free( cache_key );
cache_key = cache_key_new;
cache_paralist_new = (paralist **)
- pj_malloc(sizeof(paralist*) * cache_alloc);
+ malloc(sizeof(paralist*) * cache_alloc);
if( cache_paralist && cache_count )
{
memcpy( cache_paralist_new, cache_paralist,
sizeof(paralist*) * cache_count );
}
- pj_dalloc( cache_paralist );
+ free( cache_paralist );
cache_paralist = cache_paralist_new;
}
/*
** Duplicate the filekey and paralist, and insert in cache.
*/
- cache_key[cache_count] = (char *) pj_malloc(strlen(filekey)+1);
+ cache_key[cache_count] = (char *) malloc(strlen(filekey)+1);
strcpy( cache_key[cache_count], filekey );
cache_paralist[cache_count] = pj_clone_paralist( list );