To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxt.nxthackingOpen lugnet.robotics.nxt.nxthacking in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / NXT Firmware Hacking / 74
73  |  75
Subject: 
Re: Messing with memory pool
Newsgroups: 
lugnet.robotics.nxt.nxthacking
Date: 
Fri, 20 Jul 2007 01:08:47 GMT
Viewed: 
16951 times
  
In lugnet.robotics.nxt.nxthacking, Jeremy Rand wrote:
In lugnet.robotics.nxt.nxthacking, John Hansen wrote:
your memset call?  Can you post your replacement code?
Code is as follows:
if (!mem) mem= (char*)(VarsCmd.Pool);
memset(mem, 0, POOL_MAX_SIZE);

So you have not removed the line from cCmdInitPool where VarsCmd.Pool is set
equal to IOMapCmd.MemoryPool, correct?

Can you say where "mem" comes from and is it for certain being initialized to
zero or nil before cCmdInitPool gets called?  Is there any particular reason why
you don't just set mem equal to the correct pointer value regardless of what it
is currently set equal to (i.e., remove the if)?

Do you think
it would be easier to just allocate separate storage for the custom VM's data
and set POOL_MAX_SIZE to a very low number (maybe 4 - just something that
doesn't use up much RAM) so that the remnants of the standard NXT VM don't get
annoyed?

I think you probably will be better off with that sort of approach - especially
if the goal is to eventually clear out the rest of the standard firmware's VM
code.  I might not go quite as low as 4 but that may be completely safe.  You'll
find out soon enough, I would guess.

John Hansen



Message is in Reply To:
  Re: Messing with memory pool
 
(...) Okay, thanks for the tip. It was a bit unnecessary for you to spend two paragraphs on that, though; a sentence or two would have sufficed. :-) (...) Code is as follows: if (!mem) mem= (char*)(VarsCmd.Pool); memset(mem, 0, POOL_MAX_SIZE); I'm (...) (17 years ago, 17-Jul-07, to lugnet.robotics.nxt.nxthacking)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR