Acorn Arcade forums: Programming: Shared C Library mallocs from where?
|
Shared C Library mallocs from where? |
|
Stoppers (08:43 18/6/2010) trevj (08:56 18/6/2010) Phlamethrower (09:18 18/6/2010) Stoppers (15:46 18/6/2010)
|
|
Simon Willcocks |
Message #114646, posted by Stoppers at 08:43, 18/6/2010 |
Member
Posts: 302
|
Is it usual that the shared C Library allocates memory in the RMA rather than the Wimp Slot?
In particular, I'm using C Library 5.46 (15 Apr 2003), outside the Wimp. |
|
[ Log in to reply ] |
|
Trevor Johnson |
Message #114647, posted by trevj at 08:56, 18/6/2010, in reply to message #114646 |
Member
Posts: 660
|
I can't answer your question but you could try CLib 5.53. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #114648, posted by Phlamethrower at 09:18, 18/6/2010, in reply to message #114647 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
If you're using it in a module then yes, it allocates from the RMA. Otherwise it should come from application space (i.e. for singletasking & multitasking absolute files).
I think you can override the default memory allocator using some of the _kernel_* functions. Although if you're doing something like a module that runs as a Wimp task then you'd have to be very careful about which bits of code allocate from where (you don't want a SWI allocating from application space if it's not your module task that's paged in!) |
|
[ Log in to reply ] |
|
Simon Willcocks |
Message #114649, posted by Stoppers at 15:46, 18/6/2010, in reply to message #114648 |
Member
Posts: 302
|
Thanks for that; I've obviously done something strange in the environment that's making clib think it's running in a module.
I'm running it under ROLF, so the environment's all my fault.
I've just tried a tiny program that just calls malloc, printf and free, now, and it's getting stuff allocated in RMA, too...
(Trevor: Good suggestion, but CLib 5.53 gives me a completely different headache, so I'll leave that for the time being!)
Update: Gottit! I've not implemented teqp pc, #0 properly.
[Edited by Stoppers at 18:45, 18/6/2010] |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: Shared C Library mallocs from where? |