Changeset 34318
- Timestamp:
- Aug 16, 2012, 2:39:48 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r34315 r34318 1498 1498 1499 1499 // Function to estimate the memory consumed by a source. 1500 // Not yet complete but it counts the biggest stuff. 1501 // XXX: handle child images. For big ones the array of data pointers is significant 1502 #define IMAGE_BYTES(_im, _pix_size) (_im ? (sizeof(psImage) + (_im->numRows * _im->numCols * _pix_size)) : 0) 1500 #define IMAGE_BYTES(_im, _pix_size) (_im ? (sizeof(psImage) + (_im->numRows * sizeof(void*)) + (_im->numRows * _im->numCols * _pix_size * (_im->parent ? 0 : 1))) : 0) 1501 1503 1502 #define VECTOR_BYTES(_v, _elem_size) (_v ? (sizeof(psVector) + (_v->n * _elem_size)) : 0) 1504 1503 1505 // estimate the memory consumed by this source 1504 // estimate the memory consumed by this source. 1505 // It doesn't count everything (a couple of psArrays), the big stuff is counted 1506 1506 psU64 pmSourceMemoryUse (pmSource *source) { 1507 1507 psU64 bytes = sizeof(pmSource) + sizeof(pmPeak) + sizeof(pmMoments); 1508 1508 1509 bytes += IMAGE_BYTES(source->pixels, 4); 1510 bytes += IMAGE_BYTES(source->variance, 4); 1509 1511 bytes += IMAGE_BYTES(source->modelVar, 4); 1510 1512 bytes += IMAGE_BYTES(source->maskObj, 2); 1513 bytes += IMAGE_BYTES(source->maskView, 2); 1511 1514 bytes += IMAGE_BYTES(source->modelFlux, 4); 1512 1515 bytes += IMAGE_BYTES(source->psfImage, 4);
Note:
See TracChangeset
for help on using the changeset viewer.
