Remove ifdef and make this the default for now - and add TODO/FIXME note

This commit is contained in:
twinaphex 2020-11-08 18:31:12 +01:00
parent 6b7157b65a
commit e58cb34970

View File

@ -708,17 +708,14 @@ static int database_info_list_iterate_found_match(
const char *archive_name
)
{
#ifdef __CELLOS_LV2__
char* db_crc = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* db_playlist_base_str = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* db_playlist_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* entry_path_str = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
#else
char db_crc[PATH_MAX_LENGTH];
char db_playlist_base_str[PATH_MAX_LENGTH];
char db_playlist_path[PATH_MAX_LENGTH];
char entry_path_str[PATH_MAX_LENGTH];
#endif
/* TODO/FIXME - heap allocations are done here to avoid
* running out of stack space on systems with a limited stack size.
* We should use less fullsize paths in the future so that we don't
* need to have all these big char arrays here */
char* db_crc = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* db_playlist_base_str = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* db_playlist_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char* entry_path_str = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char *hash = NULL;
playlist_t *playlist = NULL;
const char *db_path =
@ -833,12 +830,10 @@ static int database_info_list_iterate_found_match(
db_state->list->elems[0] = entry;
}
#ifdef __CELLOS_LV2__
free(db_crc);
free(db_playlist_base_str);
free(db_playlist_path);
free(entry_path_str);
#endif
return 0;
}