AllocVecTags - Beginner.
Posted: Wed Aug 22, 2012 10:49 pm
Hi I'm a beginner can you help me?
my program crash after first allocation
this is the code:
.....
// Global vars
STRPTR *nP = NULL;
uint32 *pds = NULL;
.....
uint32 function(VOID)
{
uint32 count;
count =10;
if (!(pds = (uint32*)IExec->AllocVecTags((count * sizeof(uint32)),
AVT_Type, MEMF_SHARED,
AVT_Lock, FALSE,
AVT_ClearWithValue, 0,
TAG_END)));
{
IDOS->Printf("Alloc 1 failed\n");
return 1;
}
if (!(nP =(STRPTR*)IExec->AllocVecTags((count*sizeof(STRPTR)),
AVT_Type, MEMF_SHARED,
AVT_Lock, FALSE,
TAG_END)));
{
IDOS->Printf("Alloc 2 failed\n");
return 1;
}
........
}
Program output:
Alloc 1 failed
then program crash, the windows is impossible to close and after a few seconds the whole system freeze
(Always after any crash DSI error from OWb or other programs the whole system freeze!!!!)
thx
my program crash after first allocation
this is the code:
.....
// Global vars
STRPTR *nP = NULL;
uint32 *pds = NULL;
.....
uint32 function(VOID)
{
uint32 count;
count =10;
if (!(pds = (uint32*)IExec->AllocVecTags((count * sizeof(uint32)),
AVT_Type, MEMF_SHARED,
AVT_Lock, FALSE,
AVT_ClearWithValue, 0,
TAG_END)));
{
IDOS->Printf("Alloc 1 failed\n");
return 1;
}
if (!(nP =(STRPTR*)IExec->AllocVecTags((count*sizeof(STRPTR)),
AVT_Type, MEMF_SHARED,
AVT_Lock, FALSE,
TAG_END)));
{
IDOS->Printf("Alloc 2 failed\n");
return 1;
}
........
}
Program output:
Alloc 1 failed
then program crash, the windows is impossible to close and after a few seconds the whole system freeze
(Always after any crash DSI error from OWb or other programs the whole system freeze!!!!)
thx