Poster | Thread |
Vanhapolle
| |
is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 22-Dec-2014 14:18:04
| | [ #1 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| is shared correct kind memory when i allocate memory in AmigaOS4.1? i dont here exact flag name only is "named" is important. |
|
Status: Offline |
|
|
eliyahu
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 22-Dec-2014 14:44:46
| | [ #2 ] |
|
|
|
Super Member |
Joined: 3-Mar-2010 Posts: 1958
From: Waterbury, Connecticut (USA) | | |
|
| @Vanhapolle
the best thing to do on this question is:
1. read the exec memory allocation section on the developer wiki thoroughly 2. make sure other AOS4 developers see this question by asking at os4coding.net or the developer support forum
-- eliyahu Last edited by eliyahu on 22-Dec-2014 at 02:46 PM. Last edited by eliyahu on 22-Dec-2014 at 02:45 PM.
_________________ "Physical reality is consistent with universal laws. When the laws do not operate, there is no reality. All of this is unreal." |
|
Status: Offline |
|
|
broadblues
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 22-Dec-2014 15:51:47
| | [ #3 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @Vanhapolle
Quote:
Is shared correct kind memory when i allocate memory in AmigaOS4.1? i dont here exact flag name only is "named" is important.
|
No, unless you want to share it, then yes.
For AmigaOS4 all memory should be allocated via AllocMemVecTags() system object should be allocated with AllocSysObject() that way the correct memory type is used.
Shared memeory is used if you wat to share memeory between processes, and private memory otherwise. Also to consider is whether the memeory is locked or not shared is locked by defaul ( for backwards comptabilty) but most often doesn't need to be.
Basically allocate all memory as private and unlocked unless you have specific reason not to, such as sharing it between tasks.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 23-Dec-2014 9:04:43
| | [ #4 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @eliyahu
I cannot wrote at least yet anything i dont own yet os i wait os. Even after this maybe needed do so something which allows writing OS4coding.net. AVT_Contiguous tag is maybe needed also when i use memory area WritePixelArray way? to me is hard understand how single pointer can tell where my memory is.Someone maybe can tell to me how.
Last edited by Vanhapolle on 23-Dec-2014 at 09:10 AM.
|
|
Status: Offline |
|
|
Hans
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 23-Dec-2014 10:53:03
| | [ #5 ] |
|
|
|
Elite Member |
Joined: 27-Dec-2003 Posts: 5067
From: New Zealand | | |
|
| @Vanhapolle
Quote:
Vanhapolle wrote: @eliyahu
I cannot wrote at least yet anything i dont own yet os i wait os. Even after this maybe needed do so something which allows writing OS4coding.net. AVT_Contiguous tag is maybe needed also when i use memory area WritePixelArray way? to me is hard understand how single pointer can tell where my memory is.Someone maybe can tell to me how.
|
No, you don't need AVT_Contiguous tag for memory that you wish to use with WritePixelArray.
As Broadblues said, you should allocate memory as private, unless it's memory that will be shared between tasks (e.g., messages, which you should be allocating with AllocSysObject(), anyway).
Hans
_________________ http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project. https://keasigmadelta.com/ - More of my work. |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 23-Dec-2014 11:06:51
| | [ #6 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @Hans
good if want access it this way needs then value which function returns + (x*bytesperpixel+y*width*bytesperpixel) where is width is width of picture data,x is x coordinate pixel what i need access,and y is y coordinate pixel what i want address.bytesperpixel is value which tells how many bytes single pixel is. for ARGB its 4 and for RGB is 3 etc. and formula should be correct one.
|
|
Status: Offline |
|
|
Vanhapolle
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 25-Dec-2014 10:39:07
| | [ #7 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| I am now really angry becouse i cannot solve this simple thing how i can write and read values form this memory what i allocated. I hope someone can want help me. even sitll i asked so much.
|
|
Status: Offline |
|
|
Hypex
| |
Re: is shared correct kind memory when i allocate memory in AmigaOS4.1? Posted on 25-Dec-2014 14:07:08
| | [ #8 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11215
From: Greensborough, Australia | | |
|
| @Vanhapolle
Not to throw another spoon into the soup but probsbly using MEMF_ANY will suffice.
How have you declared your memory pointer? The following should work fine for example:
unit8 *RGB = image_ptr; // Or...
RGB = AllocVec(RGB_SIZE, MEMF_ANY);
unit red = RGB[];
uint8 green = RGB[1];
uint8 blue = *(RGB + 2);
// Untested. |
|
Status: Offline |
|
|