log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- RISC OS London Show Report 2024 (News:1)
- Announcing the TIB 2024 Advent Calendar (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- RISCOSbits releases a new laptop solution (News:)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
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
PhlamethrowerHot 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?