P
Pegboy
I need three buffers and am going to allocate memory for them, is it legal
to allocate and free the required memory with one call to malloc and free?
unsigned char *b1, *b2, *b3;
if( (b1 = (unsigned char *)malloc( 30000 )) != NULL )
{
b2 = b1 + 10000;
b3 = b2 + 10000;
/* use b1, b2 and b3 here */
free( b1 );
}
Thanks for any assistance.
to allocate and free the required memory with one call to malloc and free?
unsigned char *b1, *b2, *b3;
if( (b1 = (unsigned char *)malloc( 30000 )) != NULL )
{
b2 = b1 + 10000;
b3 = b2 + 10000;
/* use b1, b2 and b3 here */
free( b1 );
}
Thanks for any assistance.