|
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
|
|
|
|