| 310 | } |
| 311 | |
| 312 | clfftStatus FFTRepo::createPlan( clfftPlanHandle* plHandle, FFTPlan*& fftPlan ) |
| 313 | { |
| 314 | scopedLock sLock( lockRepo, _T( "insertPlan" ) ); |
| 315 | |
| 316 | // We keep track of this memory in our own collection class, to make sure it's freed in releaseResources |
| 317 | // The lifetime of a plan is tracked by the client and is freed when the client calls ::clfftDestroyPlan() |
| 318 | fftPlan = new FFTPlan; |
| 319 | |
| 320 | // We allocate a new lock here, and expect it to be freed in ::clfftDestroyPlan(); |
| 321 | // The lifetime of the lock is the same as the lifetime of the plan |
| 322 | lockRAII* lockPlan = new lockRAII; |
| 323 | |
| 324 | // Add and remember the fftPlan in our map |
| 325 | repoPlans[ planCount ] = std::make_pair( fftPlan, lockPlan ); |
| 326 | |
| 327 | // Assign the user handle the plan count (unique identifier), and bump the count for the next plan |
| 328 | *plHandle = planCount++; |
| 329 | |
| 330 | return CLFFT_SUCCESS; |
| 331 | } |
| 332 | |
| 333 | clfftStatus FFTRepo::getPlan( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockRAII*& planLock ) |
| 334 | { |
no outgoing calls
no test coverage detected