Shop OBEX P1 Docs P2 Docs Learn Events
Is there an /OPT:REF for spin? + OBEX Suggestion — Parallax Forums

Is there an /OPT:REF for spin? + OBEX Suggestion

RockyDRockyD Posts: 17
edited 2011-07-15 22:56 in Propeller 1
I have a two part suggestion / question. First, I could not seem to find the C++ linker equivalent of /OPT:REF for Spin. This would eliminate references to functions that are never referenced.

Second, my suggestion for the Object Exchange would be to expand some of the objects into larger libraries while utilizing an /OPT:REF like functionality.

I have been adding some small helper functions to my copy of FullDuplexSerial. Such as a function that will give me the amount of bytes stored in the receive buffer. And, also a function that writes to the transmit buffer, but will not wait for space to empty out (it just returns immediately with the number of bytes written).

I thought for a second that it would be great if objects like FullDuplexSerial had a more comprehensive library associated with it. But, then I realized that all of these helper functions would take up valuable memory. That got me thinking about an ability to remove unreferenced functions. Then you only pay for what you use.


Rocky

Comments

  • Heater.Heater. Posts: 21,230
    edited 2011-07-15 22:52
    The BST is a Proptool look alike that runs on Windows, Mac, and Linux. It has a bunch of useful features above the Proptool one of which is an option to remove unused methods. Just use that instead.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-07-15 22:56
    Both the BST compiler and the Propeller Backpack Loader (which can load programs to other Propeller platforms, too) have the ability to weed out unused methods.

    Regarding overloading objects like FullDuplexSerial, I believe would be better to slim them down, eliminating dec and its ilk, in favor of using similar functions in Simple_Numbers or other formatting objects. It seems like every I/O object has to have its own version of dec, hex, etc., when one central object can handle those functions just as well without the redundancy.

    -Phil
Sign In or Register to comment.