# include "psphotInternal.h"

void pmDetectionsFree (pmDetections *detections) {

  if (!detections) return;

  psFree (detections->footprints);
  psFree (detections->peaks);
  psFree (detections->oldPeaks);
  return;
}

// generate a pmDetections container with empty (allocated) footprints and peaks containers
pmDetections *pmDetectionsAlloc() {

    pmDetections *detections = (pmDetections *)psAlloc(sizeof(pmDetections));
    psMemSetDeallocator(detections, (psFreeFunc) pmDetectionsFree);

    detections->footprints = NULL;
    detections->peaks      = NULL;
    detections->oldPeaks   = NULL;
    detections->last       = 0;

    return (detections);
}

