Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2801 closed defect (fixed)

Move includes from Package.h into Package.c to minimize debugging information

Reported by: Adrian Pop Owned by: Martin Sjölund
Priority: high Milestone: 1.9.4
Component: MetaModelica Version: trunk
Keywords: Cc: Mahder Alemseged Gebremedhin

Description (last modified by Adrian Pop)

At least on Windows the omc executable has 300-400Mb which is huge
and makes debugging very slow. I suspect this happens because we
include a lot of .h files everywhere.

Currently all the includes are in Package.h and they should be moved into Package.c

Maybe even split Package.h into Package.public.h and Package.private.h and only include the Package.public.h into other .c files and the Package.private.h into Package.c.

Change History (12)

comment:1 by Adrian Pop, 10 years ago

Description: modified (diff)

comment:2 by Adrian Pop, 10 years ago

Description: modified (diff)
Summary: Move includes from Package.h into Package.cMove includes from Package.h into Package.c to minimize debugging information

comment:3 by Mahder Alemseged Gebremedhin, 10 years ago

Partially fixed in r22149 by moving all the includes from the header files to the source files.

Maybe even split Package.h into Package.public.h and Package.private.h

This will also help a lot. Specially for files like ExpressionSimplify.mo. It has 19 public functions and 99 protected functions.

We can also declare only the public functions in Package.h file and put all protected function declarations in the Package.c file (or maybe even not declare them at all and suppress the warnings.)

I think splitting is much cleaner though.

comment:4 by Mahder Alemseged Gebremedhin, 10 years ago

Cc: Mahder Alemseged Gebremedhin added

comment:5 by Martin Sjölund, 10 years ago

You can't remove them because C99 requires function prototypes to be present. Also, even if we suppress warnings, you get wrong results because the implicit arguments will typically use type int and we use long. Etc.

I would move protected declarations into the C file and also make them static functions (so other files cannot link against them).

comment:6 by Martin Sjölund, 10 years ago

DAE.FUNCTION now has a field SCode.Variability variability. I did not do anything with it yet.

comment:7 by Martin Sjölund, 10 years ago

The SimCode now moves protected functions out of the header into the C-file. They are also declared static instead of with external linkage.

comment:8 by Martin Sjölund, 9 years ago

Has this been fixed yet?

comment:9 by Adrian Pop, 9 years ago

I think so, yes.

comment:10 by Martin Sjölund, 9 years ago

Milestone: Future1.9.4
Resolution: fixed
Status: newclosed

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:12 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.