lexborisov/Modest

split source/myport/posix/mycore/perf.c

vtorri opened this issue · 2 comments

To avoid spaghetti code with plenty of #ifdef maybe splitting perf.c into several files specific to the OS would be better for maintainance

perf_common.c (code common to all the OS)
perf_linux.c
perf_darwin.c
perf_freebsd.c

also i could see that myport/posix and myport/windows_nt there are common code like memory.c

this maybe could be done by simplifying the tree:

source/myport/memory.c
source/myport/perf_common.c (perf code common to all the OS, including windows)
source/myport/perf_linux.c
source/myport/perf_darwin.c
source/myport/perf_freebsd.c
source/myport/perf_windows.c
etc...

Hi!
For Windows source/myport/windows_nt/mycore/perf.c
For all Posix system source/myport/posix/mycore/perf.c
and yes, we need to split perf.c for Posix system:

perf_darwin.c
perf_freebsd.c
perf_linux.c

But now perf.c not used. This is file for future

looking at lexbor only now, closing