merthsoft wrote:
The way it is now, it just created 500 byte appvars for everything. I might change that if I feel it's too much or too little. Maybe let people set the size of their log file Smile
Oooh, that would be cool too! I think 500 bytes sounds reasonable, though. I'm wondering if there might still be 500 bytes of SafeRAM you could use, though.
But AppVars are so cool!
merthsoft wrote:
But AppVars are so cool!
True. So maybe you should stick with that for now for the sake of coolness and experience with using Appvars?
Is there a compelling reason to use saferam over appvars?
merthsoft wrote:
Is there a compelling reason to use saferam over appvars?
The only reason would be to allow people with [size of your program] bytes of RAM free instead of [size of your program + 500] bytes of RAM free to run your program. It might also simplify things a hair, since Appvars have variable addresses and safeRAM is fixed. On the plus side, though, it'll give you some excellent practice with using Appvars and programs and other datatypes that like to run about in memory.
So it's possible even after having created an appvar, that it'll be somewhere else during execution?
If its only 500 bytes you could use a temp area like StatsVars or if you need those for something else, insert a label at the end of your program, and _InsertMem however much memory you need. This way you can use it in your program but not cost the user extra space for the prog. Just remember to free it when your done
Well, I need three chunks of 500 bytes. Can I use _InstertMem three times? How does it work?
You could just ask for 1500 bytes when using InsertMem. You would then need to use DelMem to "free" the memory. You should use EnoughMem first to check that there are at least 1500 free bytes (InsertMem does not check free RAM for you).
BuckeyeDude wrote:
If its only 500 bytes you could use a temp area like StatsVars or if you need those for something else, insert a label at the end of your program, and _InsertMem however much memory you need. This way you can use it in your program but not cost the user extra space for the prog. Just remember to free it when your done
Part of the problem is that the DCS GUI system rampages through some of SafeRAM, and CALCnet 2.2 consumes another section for its buffers, so Merth is getting the short end of the stick both ways. Sad
So then what's the difference between creating an appvar and using InsertMem? Just that appvars might move around? Also, I still have this question
Quote:
So it's possible even after having created an appvar, that it'll be somewhere else during execution?
If you do anything that causes variables to be shuffled in memory (such as creating new ones, deleting old ones, using InsertMem/DelMem/EnoughMem) then yes, the AppVar may move. Use ChkFindSym to retrieve the current address if you move things around.
benryves wrote:
If you do anything that causes variables to be shuffled in memory (such as creating new ones, deleting old ones, using InsertMem/DelMem/EnoughMem) then yes, the AppVar may move. Use ChkFindSym to retrieve the current address if you move things around.
Specifically, Doors CS moves the gui7 AppVar that it creates to high memory so it can grow and shrink at minimal CPU cycle cost.
When does that happen?
merthsoft wrote:
When does that happen?
Usually it's just invoked on OpenGUIStack and on FileOpen/FileSaveAs.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 6 of 6
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement