A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / even memory allocation

 

Author Message
dalton
Member
#1 - Posted: 14 Sep 2006 22:07
Reply Quote
Anyone knows a good way to allocate memory in an address aligned way?

To be more exact I want my bitplanes to be aligned to 64k. I suppose one way to do it would be to allocate 64k more than needed and then use the next memory page looking from start address. But that's a bit cheap and when talking chip these extra few k's actually matter.
winden
Member
#2 - Posted: 14 Sep 2006 22:53
Reply Quote
exec provides a call where you ask for a block of memory at an exact adress with an exact size. if it's free it gives to you, else it tells you the alloc failed... maybe i recall it was called "allocabs"? So for getting aligned to 64k, just iterate over the mmory range you want and ask for addresses with 64k alignement.... you will then need to also get a look at the memory maps from exec to determine where is chipmem and fastmem available (please don't hardcode that ;)
Cefa
Member
#3 - Posted: 19 Sep 2006 18:41
Reply Quote
I think the function AllocBitMap() gives you 64-bit align chipmen. But make sure using Autodocs or search the net.
dalton
Member
#4 - Posted: 24 Sep 2006 15:06
Reply Quote
seems allocbitmap() is for system screens or something. guess i'll look into the allocabs() solution. thanks!

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0