Initialize allocated storage: */
| 80 | |
| 81 | /* Initialize allocated storage: */ |
| 82 | static void |
| 83 | icvInitMemStorage( CvMemStorage* storage, int block_size ) |
| 84 | { |
| 85 | if( !storage ) |
| 86 | CV_Error( CV_StsNullPtr, "" ); |
| 87 | |
| 88 | if( block_size <= 0 ) |
| 89 | block_size = CV_STORAGE_BLOCK_SIZE; |
| 90 | |
| 91 | block_size = cvAlign( block_size, CV_STRUCT_ALIGN ); |
| 92 | assert( sizeof(CvMemBlock) % CV_STRUCT_ALIGN == 0 ); |
| 93 | |
| 94 | memset( storage, 0, sizeof( *storage )); |
| 95 | storage->signature = CV_STORAGE_MAGIC_VAL; |
| 96 | storage->block_size = block_size; |
| 97 | } |
| 98 | |
| 99 | |
| 100 | /* Create root memory storage: */ |
no test coverage detected