mohdshamilshafi / cudpp

Automatically exported from code.google.com/p/cudpp
Other
0 stars 0 forks source link

CUDPPPlanManager::AddPlan() generates handles improperly #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
CUDPPPlanManager::AddPlan() in cudpp_plan_manager.cpp contains the line

CUDPPHandle handle = (CUDPPHandle)m_instance->plans.size();

If a client application was to, say, allocate two plans then free the first 
one, the next call to AddPlain() will fail because the map would be of size 1.
Suggestion: replace the line with

CUDPPHandle 
handle=m_instance->plans.size()?(m_instance->plans.rbegin()->first+1):0;

Original issue reported on code.google.com by helios....@gmail.com on 15 Jul 2011 at 10:56

GoogleCodeExporter commented 8 years ago
There is no planmanager anymr in the trunk, so will not fix this (1.1.1 is the 
end of the line for the Old interface).

Original comment by harr...@gmail.com on 17 Jul 2011 at 2:35