jayacotton / inettools-z80

Inet tools for z80-rc2014 tcp/ip stack code.
MIT License
17 stars 2 forks source link

Size trimming #18

Open suborb opened 3 years ago

suborb commented 3 years ago

Hope you don't mind, I'm just going to drop some hints on size trimming at link time.

From this I can see a lot of printf formatters being pulled in. You can configure which ones are pulled in by adding the following to zpragma.inc:

#pragma printf "%s %02d %c %u"

Which probably covers most of the cases you've got, this will save a few hundred bytes. You can do the same with the scan formatters (#pragma scanf)

Some compile time ones that may not be obvious:

jayacotton commented 3 years ago

Thanks for the tips. I used the pragma printf and scanf to cut about 1k of code space.

suborb commented 3 years ago

No worries, one other thing, --c-code-in-asm will prevent some of the optimisation rules from firing so you might want to consider removing that at some point.

jayacotton commented 1 year ago

More thoughts on this aspect of the project.

  1. Implement all of the above as it applies.
  2. The code assumes that each app is standalone, this may not be true in all cases.
  3. implement an overlay or subdivide the tasks, i.e. ifconfig could configure all the required network attachments and leave only socket and to the app.