void test_byte(void * pParam) { RAW_U16 ret; RAW_U32 i = 0; raw_byte_pool_create(&byte_mem_pool_test, (RAW_U8 *)"byte", byte_mem_pool, 1024 * 1024); while (1) { i++; ret = raw_byte_allocate(&byte_mem_pool_test, (RAW_VOID **)&aa, 2022); if (ret == RAW_NO_MEMORY) { vc_port_printf("RAW_NO_MEMORY\n"); RAW_ASSERT(0); } ret = raw_byte_allocate(&byte_mem_pool_test, (RAW_VOID **)&bb, 2000); if (ret == RAW_NO_MEMORY) { vc_port_printf("RAW_NO_MEMORY\n"); RAW_ASSERT(0); } raw_byte_release(&byte_mem_pool_test, bb); vc_port_printf("allocate byte %d\n", i); } }
void test_byte() { if(1 == test_switch) { return; } test_switch = 1; if (RAW_SUCCESS != raw_byte_pool_create(&byte_pool, "pool_byte1", buffer, 1024)) { __put_char("error ", 6); return; } raw_task_create(&test_task_obj, (RAW_U8 *)"task1", 0, 5, 10, test_task_stack1, TEST_TASK_STK_SIZE , test_task1, 1); }