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
- Rougol April 2024 meeting on monday is Anniversary time (News:1)
- WROCC April 2024 meeting o...changes to our phone lines (News:1)
- April developer 'fireside' chat is on saturday night (News:)
- March 2024 News Summary (News:4)
- WROCC Newsletter Volume 41:11 reviewed (News:)
- WROCC March 2024 meeting o... Hughes and Peter Richmond (News:1)
- Rougol March 2024 meeting on monday with Bernard Boase (News:)
- Drag'n'Drop 13i2 edition reviewed (News:)
- South-West Show 2024 talks (News:4)
- February 2024 News Summary (News:1)
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
The Icon Bar: Programming: Shared C Library mallocs from where?
 
  Shared C Library mallocs from where?
  Stoppers (09:43 18/6/2010)
  trevj (09:56 18/6/2010)
    Phlamethrower (10:18 18/6/2010)
      Stoppers (16:46 18/6/2010)
 
Simon Willcocks Message #114646, posted by Stoppers at 09: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 09: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 10: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 16: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 ]
 

The Icon Bar: Programming: Shared C Library mallocs from where?