代码如下:
int *pArray[100];
for ( i = 0 ; i < 10 ; i ++ )
{
for( j = 0 ; j < 10 ; j ++ )
{
pArray[ i*10 +j] = OslMalloc(1000);
}
}
如上的一段代码运行会提示出错,出错时i = 8,j = 2
出错信息:
OSC 0x b44> ERROR: (E:\temp\07AMP\modis\oscar\src\osc_buffer.c #429) OSC_Buffer_
Alloc: -30
[1] Fatal Error (804): Buffer not available - MMI
请问是怎么回事。难道MTK中分配的内存块的个数还是有限制的吗?只听说好像一次申请的大小不能超过2K。
------解决方案--------------------------------------------------------
也考虑用这些API:
#define media_get_ext_buffer(src_mod_id, buffer_p, buffer_size)\
media_get_ext_buffer_ext(src_mod_id,buffer_p, buffer_size,__FILE__,__LINE__)
#define media_get_int_buffer(src_mod_id, buffer_p, buffer_size)\
media_get_int_buffer_ext(src_mod_id,buffer_p,buffer_size,__FILE__,__LINE__)
#define media_free_int_buffer(src_mod_id, buffer_p)\
media_free_int_buffer_ext(src_mod_id, buffer_p, __FILE__, __LINE__)
#define media_free_ext_buffer(src_mod_id, buffer_p)\
media_free_ext_buffer_ext(src_mod_id, buffer_p, __FILE__, __LINE__)