memory use
Speaker337
Posts: 14
New to the propeller. If I have several objects that all are instances of FullDuplexSerial does FullDuplexSerial get loaded several times or just once? If I only use two methods, is it worth renaming it and stripping out all the methods that are not going to be used?
Comments
MyObj.spin:
MyObj is instanciating FullDuplexSerial. fd is an instance of FullDuplexSerial.
So, with this common definition you question makes no sense, but kuroneko seems to be understanding what you meant.
With the propeller tool it does no make sense to remove function A of FDS in one module and function B of FDS in another module because these are not used there. The propeller tool will then no longer detect, that the rest of the functions are the same. For example:
Now you have 2 copies of the common code of FullDuplexSerial in your main. Hence, these include PRI functions and DAT sections.
In this case it would be better to use FullDuplexSerial only. All functions and DAT sections will only be there once. The VAR section is duplicated but that's needed anyway.