Commit 494697b0 authored by Alessandro Rubini's avatar Alessandro Rubini

arch startup: alloc max_links instances

The next commit makes a little order in startup files, and config file
parsing ends up after all allocations, so we can't reply on
ppg->nlinks to be properly set.

In hosted environments we have no issues with a few kilobytes more, so
allocate the max number of instances even if less are used.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 90c7f385
...@@ -76,7 +76,7 @@ int main(int argc, char **argv) ...@@ -76,7 +76,7 @@ int main(int argc, char **argv)
ppg->parentDS = calloc(1, sizeof(*ppg->parentDS)); ppg->parentDS = calloc(1, sizeof(*ppg->parentDS));
ppg->timePropertiesDS = calloc(1, sizeof(*ppg->timePropertiesDS)); ppg->timePropertiesDS = calloc(1, sizeof(*ppg->timePropertiesDS));
ppg->arch_data = calloc(1, sizeof(struct unix_arch_data)); ppg->arch_data = calloc(1, sizeof(struct unix_arch_data));
ppg->pp_instances = calloc(ppg->nlinks, sizeof(struct pp_instance)); ppg->pp_instances = calloc(ppg->max_links, sizeof(struct pp_instance));
if ((!ppg->defaultDS) || (!ppg->currentDS) || (!ppg->parentDS) if ((!ppg->defaultDS) || (!ppg->currentDS) || (!ppg->parentDS)
|| (!ppg->timePropertiesDS) || (!ppg->arch_data) || (!ppg->timePropertiesDS) || (!ppg->arch_data)
......
...@@ -103,7 +103,7 @@ int main(int argc, char **argv) ...@@ -103,7 +103,7 @@ int main(int argc, char **argv)
ppg->parentDS = calloc(1, sizeof(*ppg->parentDS)); ppg->parentDS = calloc(1, sizeof(*ppg->parentDS));
ppg->timePropertiesDS = calloc(1, sizeof(*ppg->timePropertiesDS)); ppg->timePropertiesDS = calloc(1, sizeof(*ppg->timePropertiesDS));
ppg->arch_data = calloc(1, sizeof(struct unix_arch_data)); ppg->arch_data = calloc(1, sizeof(struct unix_arch_data));
ppg->pp_instances = calloc(ppg->nlinks, sizeof(struct pp_instance)); ppg->pp_instances = calloc(ppg->max_links, sizeof(struct pp_instance));
if ((!ppg->defaultDS) || (!ppg->currentDS) || (!ppg->parentDS) if ((!ppg->defaultDS) || (!ppg->currentDS) || (!ppg->parentDS)
|| (!ppg->timePropertiesDS) || (!ppg->arch_data) || (!ppg->timePropertiesDS) || (!ppg->arch_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment