Clears memory storage (return blocks to the parent, if any): */
| 188 | |
| 189 | /* Clears memory storage (return blocks to the parent, if any): */ |
| 190 | CV_IMPL void |
| 191 | cvClearMemStorage( CvMemStorage * storage ) |
| 192 | { |
| 193 | if( !storage ) |
| 194 | CV_Error( CV_StsNullPtr, "" ); |
| 195 | |
| 196 | if( storage->parent ) |
| 197 | icvDestroyMemStorage( storage ); |
| 198 | else |
| 199 | { |
| 200 | storage->top = storage->bottom; |
| 201 | storage->free_space = storage->bottom ? storage->block_size - sizeof(CvMemBlock) : 0; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | |
| 206 | /* Moves stack pointer to next block. |
no test coverage detected