Obvious, only there where is needed. And where is needed, it must be
only a file/library with the construction bellow.

 -- lot of procedures
 -- another procedure
 {$OPTIMIZE SPEED} -- this can be changed by user
  IF DEFINED(OPTIMIZE_SPEED) THEN
    -- write code which save on cycles
  ELSE
   -- write code which save on size
  END IF

 -- another procedure
 {$OPTIMIZE SIZE} -- this can be changed by user
  IF DEFINED(OPTIMIZE_SPEED) THEN
    -- write code which save on cycles
  ELSE
   -- write code which save on size
  END IF

If Matt want speed, but the code does not fit and don't want to buy
another microcontroller, then can tune some of the procedures inside,
changing the option. And keeping the speed option for the rest of the
code. But again, I'm not suggesting that all libraries must be made in
the same manner.

On Jan 8, 11:31 am, Oliver Seitz <[email protected]> wrote:
>  IF DEFINED(OPTIMIZE_SPEED) THEN
>    -- write code which save on cycles
>  ELSE
>   -- write code which save on size
>  END IF
>
> That is one of the possibilities JALv2 offers. It is conditional compiling if 
> the "if" statement is determined at compile time. I don't need extra compiler 
> constructs for a feature the language already offers.
>
> > Can
> > be this made
> > optional on specific local code, and not global at entire
> > code? In PMP
> > is possible.
>
> To optimize one lib for speed and another one for size? You would have to 
> define different constants for the different libs, I think. But lots of the 
> libs, especially those dealing with integrated peripherals do not leave much 
> room for optimization in either way, so I doubt it would be worth to 
> optimize, say, serial_hardware for speed or size.
>
> Greets,
> Kiste

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to