English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 29 November 2014, 21:52   #1
bodhi
Registered User
bodhi's Avatar
 
Join Date: Nov 2012
Location: GB
Posts: 32
Mem allocation routines safe, in metal mode?

Hello,

I have a question that is nagging me. In my code, I have disabled all system interrupts, DMA, using custom copper, etc. All the stuff you usually do when bypassing AmigaOS.

I just want to know, is it right, wrong, or just OK to continue to use Amiga memory allocation routines when the system is in this state? After taking over the Amiga, I'm currently using AllocRaster(). It seems to work fine and returns a valid pointer which I'm using with no issues. When I return control to AmigaOS, Workbench seems to be happy.

But is this proper procedure and a normal thing to do? I hve a sneaky feeling that it's not quite legit and that disabling system multitasking, etc. may interfer with the OS's ability to properly allocate memory? (updating sys mem free lists, etc.) Or something...

Any advice?
bodhi is offline  
AdSense AdSense  
Old 29 November 2014, 22:00   #2
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
yeah allocating memory is fine i think, there's no interrupt or background process involved in that. it's disk operations you need to worry about.
Mrs Beanbag is offline  
Old 29 November 2014, 22:37   #3
bodhi
Registered User
bodhi's Avatar
 
Join Date: Nov 2012
Location: GB
Posts: 32
"no...background process involved"

Yeah, I think that's what I was most unsure/worried about...what with using forbid() and wotnot. Thanks for clearing that up.
bodhi is offline  
Old 29 November 2014, 22:45   #4
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
the typical way to shrink an area of reserved memory is to Forbid(), FreeMem() and then AllocAbs() and Permit() - so that some other process doesn't by chance get hold of your memory in the middle! So yes it is definitely safe to allocate memory during the Forbid state.
Mrs Beanbag is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
decompression routines Toni Wilen Coders. General 12 17 May 2017 01:30
[SOLVED] GCC (g++) Memory allocation issues NovaCoder Coders. Language 36 08 June 2015 22:12
"special" chip-mem allocation 68K-ASM Herpes Coders. System 4 13 June 2013 12:42
Checksum routines in games Joejoe Coders. Tutorials 11 26 December 2009 21:24
Tilemap + Scrolling routines source code Ultron Coders. General 0 02 April 2007 02:00

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:14.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.11122 seconds with 12 queries