本文整理汇总了C++中LALCheckMemoryLeaks函数的典型用法代码示例。如果您正苦于以下问题:C++ LALCheckMemoryLeaks函数的具体用法?C++ LALCheckMemoryLeaks怎么用?C++ LALCheckMemoryLeaks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LALCheckMemoryLeaks函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: testPadding
/* test to make sure padding does what it's supposed to do */
static int testPadding( void )
{
int keep = lalDebugLevel;
XLALClobberDebugLevel(lalDebugLevel | LALMEMDBGBIT | LALMEMPADBIT);
XLALClobberDebugLevel(lalDebugLevel & ~LALMEMTRKBIT);
/* try to free NULL pointer */
/* changed behaviour: LALFree is a no-op when passed NULL */
// trial( LALFree( NULL ), SIGSEGV, "error: tried to free NULL pointer" );
/* double free */
/* actually, this cannot be done robustly -- system can change values
* in unallocated space at will */
//trial( p = LALMalloc( 2 * sizeof( *p ) ), 0, "" );
//trial( LALFree( p ), 0, "" );
//trial( LALFree( p ), SIGSEGV, "error: tried to free a freed pointer" );
//trial( LALCheckMemoryLeaks(), 0, "" );
/* wrong magic */
trial( p = LALMalloc( 2 * sizeof( *p ) ), 0, "" );
p[-1] = 4;
trial( LALFree( p ), SIGSEGV, "error: wrong magic" );
p[-1] = 0xABadCafe;
trial( LALFree( p ), 0, "" );
trial( LALCheckMemoryLeaks(), 0, "" );
/* corrupt size */
trial( p = LALMalloc( 4 * sizeof( *p ) ), 0, "");
n = p[-2];
p[-2] = -2;
trial( LALFree( p ), SIGSEGV, "error: corrupt size descriptor" );
p[-2] = n;
trial( LALFree( p ), 0, "" );
trial( LALCheckMemoryLeaks(), 0, "" );
/* overwritten array bounds */
trial( p = LALMalloc( 8 * sizeof( *p ) ), 0, "" );
n = p[8];
p[8] = 0;
trial( LALFree( p ), SIGSEGV, "error: array bounds overwritten" );
p[8] = n;
trial( LALFree( p ), 0, "" );
trial( LALCheckMemoryLeaks(), 0, "" );
/* free too much memory */
q = malloc( 4 * sizeof( *p ) );
trial( p = LALMalloc( sizeof( *p ) ), 0, "" );
memcpy( q, p - 2, 4 * sizeof( *p ) );
trial( LALFree( p ), 0, "" );
trial( LALFree( q + 2 ), SIGSEGV, "error: lalMallocTotal too small" );
free( q );
trial( LALCheckMemoryLeaks(), 0, "" );
XLALClobberDebugLevel(keep);
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:58,代码来源:LALMallocTest.c
示例2: main
/*---------- function definitions ---------- */
int main(int argc,char *argv[])
{
LALStatus status = blank_status; /* initialize status */
vrbflg = 1; /* verbose error-messages */
/* set LAL error-handler */
lal_errhandler = LAL_ERR_EXIT; /* exit with returned status-code on error */
/* register all user-variables */
LAL_CALL (InitUserVars(&status, &CommandLineArgs), &status);
/* read cmdline & cfgfile */
BOOLEAN should_exit = 0;
XLAL_CHECK_MAIN (XLALUserVarReadAllInput(&should_exit, argc, argv, lalAppsVCSInfoList) == XLAL_SUCCESS, XLAL_EFUNC);
if (should_exit)
return EXIT_FAILURE;
LAL_CALL ( CheckUserInput (&status, &CommandLineArgs), &status);
LAL_CALL ( Initialize (&status, &CommandLineArgs), &status);
/*---------- central function: compute F-statistic ---------- */
LAL_CALL ( ComputeF(&status, CommandLineArgs), &status);
/* Free remaining memory */
LAL_CALL ( LALSDestroyVector(&status, &(amc.a) ), &status);
LAL_CALL ( LALSDestroyVector(&status, &(amc.b) ), &status);
XLALDestroyUserVars();
LALCheckMemoryLeaks();
return 0;
} /* main() */
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:36,代码来源:SemiAnalyticF.c
示例3: main
int main( int argc, char *argv[] )
{
LALFILE *outfile = NULL;
LALCache *cache;
int arg = 1;
XLALSetErrorHandler( XLALExitErrorHandler );
if ( argc > 1 && ! strcmp(argv[1],"-o") ) {
outfile = XLALFileOpen( argv[2], "w" );
arg += 2;
}
cache = XLALCacheGlob( NULL, argc == 1 ? NULL : argv[arg] );
for ( ; arg < argc; ++arg ) {
LALCache *tmp = cache;
LALCache *add;
add = XLALCacheGlob( NULL, argv[arg] );
cache = XLALCacheMerge( tmp, add );
XLALDestroyCache( add );
XLALDestroyCache( tmp );
}
XLALCacheFileWrite( outfile ? outfile : LALSTDOUT, cache );
XLALFileClose( outfile );
XLALDestroyCache( cache );
LALCheckMemoryLeaks();
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:25,代码来源:cache.c
示例4: main
/* ********************************************************/
int main(int UNUSED argc, char **argv)
{
static LALStatus status; /* status structure */
/* initialize status */
status.statusCode = 0;
status.statusPtr = NULL;
status.statusDescription = NULL;
/* Actual test are performed by this function */
/* RunGeneratePulsarSignalTest(&status,argc,argv); */ /* 02/02/05 gam */
RunGeneratePulsarSignalTest(&status);
if (status.statusCode) {
fprintf(stderr,"Error: statusCode = %i statusDescription = %s \n", status.statusCode, status.statusDescription);
return 1;
}
LALCheckMemoryLeaks();
if ( lalDebugLevel & LALINFO ) {
XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n"
" %s\n", *argv, __FILE__, __LINE__,
"$Id$", (GENERATEPULSARSIGNALTESTC_MSGENORM) );
}
return GENERATEPULSARSIGNALTESTC_ENORM;
}
开发者ID:johnveitch,项目名称:lalsuite,代码行数:31,代码来源:GeneratePulsarSignalTest.c
示例5: main
int main( void )
{
#if defined(NDEBUG) /* debugging is turned off */
return 77; /* don't do any testing */
#else
XLALGetDebugLevel();
XLALClobberDebugLevel(LALMEMDBG);
/* get rid of annoying messages from elsewhere */
setvbuf( mystderr = stdout, NULL, _IONBF, 0 );
FILE *fp = freopen( "/dev/null", "w", stderr );
if (fp == NULL) die ( unable to open /dev/null );
lalRaiseHook = TestRaise;
if ( lalNoDebug ) /* library was not compiled with debugging */
return 77; /* don't do any testing */
if ( testOK() ) return 1;
if ( testPadding() ) return 1;
if ( testAllocList() ) return 1;
if ( stressTestRealloc() ) return 1;
trial( LALCheckMemoryLeaks(), 0, "" );
return 0;
#endif
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:28,代码来源:LALMallocTest.c
示例6: main
int main( void )
{
CircularOrbit();
EccentricOrbit();
LALCheckMemoryLeaks();
return 0;
}
开发者ID:SwethaPBhagwat,项目名称:lalsuite,代码行数:7,代码来源:ODETest.c
示例7: main
int main(void)
{
XLALSetErrorHandler(XLALAbortErrorHandler);
test_orf();
LALCheckMemoryLeaks();
return 0;
}
开发者ID:Solaro,项目名称:lalsuite,代码行数:7,代码来源:LALSimSGWBORF.c
示例8: main
int main(int argc, char *argv[])
{
char tstr[32]; // string to hold GPS time -- 31 characters is enough
const double H0 = 0.72 * LAL_H0FAC_SI; // Hubble's constant in seconds
const size_t length = 65536; // number of points in a segment
const size_t stride = length / 2; // number of points in a stride
size_t i, n;
REAL8FrequencySeries *OmegaGW = NULL;
REAL8TimeSeries **seg = NULL;
LIGOTimeGPS epoch;
gsl_rng *rng;
XLALSetErrorHandler(XLALAbortErrorHandler);
parseargs(argc, argv);
XLALGPSSetREAL8(&epoch, tstart);
gsl_rng_env_setup();
rng = gsl_rng_alloc(gsl_rng_default);
OmegaGW = XLALSimSGWBOmegaGWFlatSpectrum(Omega0, flow, srate/length, length/2 + 1);
n = duration * srate;
seg = LALCalloc(numDetectors, sizeof(*seg));
printf("# time (s)");
for (i = 0; i < numDetectors; ++i) {
char name[LALNameLength];
snprintf(name, sizeof(name), "%s:STRAIN", detectors[i].frDetector.prefix);
seg[i] = XLALCreateREAL8TimeSeries(name, &epoch, 0.0, 1.0/srate, &lalStrainUnit, length);
printf("\t%s (strain)", name);
}
printf("\n");
XLALSimSGWB(seg, detectors, numDetectors, 0, OmegaGW, H0, rng); // first time to initilize
while (1) { // infinite loop
size_t j;
for (j = 0; j < stride; ++j, --n) { // output first stride points
LIGOTimeGPS t = seg[0]->epoch;
if (n == 0) // check if we're done
goto end;
printf("%s", XLALGPSToStr(tstr, XLALGPSAdd(&t, j * seg[0]->deltaT)));
for (i = 0; i < numDetectors; ++i)
printf("\t%e", seg[i]->data->data[j]);
printf("\n");
}
XLALSimSGWB(seg, detectors, numDetectors, stride, OmegaGW, H0, rng); // make more data
}
end:
for (i = 0; i < numDetectors; ++i)
XLALDestroyREAL8TimeSeries(seg[i]);
XLALFree(seg);
XLALDestroyREAL8FrequencySeries(OmegaGW);
LALCheckMemoryLeaks();
return 0;
}
开发者ID:ahnitz,项目名称:lalsuite,代码行数:57,代码来源:sgwb.c
示例9: main
int main( int argc, char *argv[]) {
/* sanity check for input arguments */
if ( argc != 1 )
XLAL_ERROR ( XLAL_EINVAL, "The executable '%s' doesn't support any input arguments right now.\n", argv[0] );
printf ("Starting test...\n");
/* set up single- and multi-IFO F-stat input */
REAL4 TwoF = 7.0;
UINT4 numDetectors = 2;
REAL4Vector *TwoFX = NULL;
if ( (TwoFX = XLALCreateREAL4Vector ( numDetectors )) == NULL ) {
XLAL_ERROR ( XLAL_EFUNC, "failed to XLALCreateREAL4Vector( %d )\n", numDetectors );
return XLAL_EFAILED;
}
TwoFX->data[0] = 4.0;
TwoFX->data[1] = 12.0;
REAL8 rhomaxline = 0.0; /* prior from LV-stat derivation, 0 means pure line veto, +inf means pure multi-Fstat */
REAL8Vector *lX = NULL; /* per-IFO prior odds ratio for line vs. Gaussian noise, NULL is interpreted as l[X]=1 for all X */
/* maximum allowed difference between recalculated and XLAL result */
REAL4 tolerance_allterms = 2e-04;
REAL4 tolerance_leadterm = 2e-02;
/* compute and compare the results for one set of rhomaxline, lX values */
printf ("Computing LV-stat for TwoF_multi=%f, TwoFX[0]=%f, TwoFX[1]=%f, rhomaxline=%f, priors lX=NULL...\n", TwoF, TwoFX->data[0], TwoFX->data[1], rhomaxline );
if ( XLALCompareLVComputations( TwoF, TwoFX, rhomaxline, lX, tolerance_allterms, tolerance_leadterm ) != XLAL_SUCCESS ) {
XLAL_ERROR ( XLAL_EFUNC, "Test failed.\n" );
return XLAL_EFAILED;
}
/* change the priors to catch more possible problems */
rhomaxline = 5.0;
if ( (lX = XLALCreateREAL8Vector ( numDetectors )) == NULL ) {
XLAL_ERROR ( XLAL_EFUNC, "failed to XLALCreateREAL8Vector( %d )\n", numDetectors );
return XLAL_EFAILED;
}
lX->data[0] = 0.5;
lX->data[1] = 0.8;
/* compute and compare the results for second set of rhomaxline, lX values */
printf ("Computing LV-stat for TwoF_multi=%f, TwoFX[0]=%f, TwoFX[1]=%f, rhomaxline=%f, priors lX=(%f,%f)...\n", TwoF, TwoFX->data[0], TwoFX->data[1], rhomaxline, lX->data[0], lX->data[1] );
if ( XLALCompareLVComputations( TwoF, TwoFX, rhomaxline, lX, tolerance_allterms, tolerance_leadterm ) != XLAL_SUCCESS ) {
XLAL_ERROR ( XLAL_EFUNC, "Test failed.\n" );
return XLAL_EFAILED;
}
/* free memory */
XLALDestroyREAL4Vector(TwoFX);
XLALDestroyREAL8Vector(lX);
LALCheckMemoryLeaks();
return XLAL_SUCCESS;
} /* main */
开发者ID:smirshekari,项目名称:lalsuite,代码行数:57,代码来源:LineRobustStatsTest.c
示例10: main
/* ----- function definitions ---------- */
int
main ( void )
{
LALStatus XLAL_INIT_DECL(status);
SFTCatalog *catalog = NULL;
SFTConstraints XLAL_INIT_DECL(constraints);
MultiSFTVector *multiSFTs = NULL;
MultiPSDVector *multiPSDs = NULL;
MultiNoiseWeights *multiWeightsXLAL = NULL;
MultiNoiseWeights *multiWeightsCorrect = NULL;
UINT4 rngmedBins = 11;
REAL8 tolerance = 2e-6; /* same algorithm, should be basically identical results */
/* Construct the "correct" weights, calculated using the old LAL routines */
UINT4 numIFOsCorrect = 2;
XLAL_CHECK ( ( multiWeightsCorrect = XLALCalloc ( 1, sizeof(*multiWeightsCorrect ) ) ) != NULL, XLAL_ENOMEM );
multiWeightsCorrect->length = numIFOsCorrect;
multiWeightsCorrect->Sinv_Tsft = 1.980867126449e+52;
XLAL_CHECK ( ( multiWeightsCorrect->data = XLALCalloc ( numIFOsCorrect, sizeof(*multiWeightsCorrect->data ) ) ) != NULL, XLAL_ENOMEM );
XLAL_CHECK ( ( multiWeightsCorrect->data[0] = XLALCreateREAL8Vector(4) ) != NULL, XLAL_ENOMEM );
multiWeightsCorrect->data[0]->data[0] = 6.425160659487e-05;
multiWeightsCorrect->data[0]->data[1] = 7.259453662367e-06;
multiWeightsCorrect->data[0]->data[2] = 9.838893684664e-04;
multiWeightsCorrect->data[0]->data[3] = 5.043766789923e-05;
XLAL_CHECK ( ( multiWeightsCorrect->data[1] = XLALCreateREAL8Vector(3) ) != NULL, XLAL_ENOMEM );
multiWeightsCorrect->data[1]->data[0] = 1.582309910283e-04;
multiWeightsCorrect->data[1]->data[1] = 5.345673753744e-04;
multiWeightsCorrect->data[1]->data[2] = 6.998201363537e+00;
/* Construct the catalog */
XLAL_CHECK ( ( catalog = XLALSFTdataFind ( TEST_DATA_DIR "MultiNoiseWeightsTest*.sft", &constraints ) ) != NULL, XLAL_EFUNC, " XLALSFTdataFind failed\n" );
/* Load the SFTs */
XLAL_CHECK ( ( multiSFTs = XLALLoadMultiSFTs ( catalog, -1, -1 ) ) != NULL, XLAL_EFUNC, " XLALLoadMultiSFTs failed\n" );
/* calculate the psd and normalize the SFTs */
XLAL_CHECK ( ( multiPSDs = XLALNormalizeMultiSFTVect ( multiSFTs, rngmedBins, NULL ) ) != NULL, XLAL_EFUNC, " XLALNormalizeMultiSFTVect failed\n" );
/* Get weights using XLAL function */
XLAL_CHECK ( ( multiWeightsXLAL = XLALComputeMultiNoiseWeights ( multiPSDs, rngmedBins, 0 ) ) != NULL, XLAL_EFUNC, " XLALComputeMultiNoiseWeights failed\n" );
/* Compare XLAL weights to reference */
XLAL_CHECK ( XLALCompareMultiNoiseWeights ( multiWeightsXLAL, multiWeightsCorrect, tolerance ) == XLAL_SUCCESS, XLAL_EFAILED, "Comparison between XLAL and reference MultiNoiseWeights failed\n" );
/* Clean up memory */
XLALDestroyMultiNoiseWeights ( multiWeightsCorrect );
XLALDestroyMultiNoiseWeights ( multiWeightsXLAL );
XLALDestroyMultiPSDVector ( multiPSDs );
XLALDestroyMultiSFTVector ( multiSFTs );
XLALDestroySFTCatalog ( catalog );
/* check for memory-leaks */
LALCheckMemoryLeaks();
return XLAL_SUCCESS;
} /* main() */
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:57,代码来源:XLALMultiNoiseWeightsTest.c
示例11: Freemem
int Freemem(void)
{
LALFree(po);
LALFree(p);
LALCheckMemoryLeaks();
return 0;
}
开发者ID:smirshekari,项目名称:lalsuite,代码行数:10,代码来源:psd.c
示例12: main
int main( void )
{
/* Create hash table */
LALBitset *bs = XLALBitsetCreate();
XLAL_CHECK_MAIN( bs != NULL, XLAL_EFUNC );
/* Create some random bits */
BOOLEAN XLAL_INIT_DECL( bits, [4096] );
gsl_rng *r = gsl_rng_alloc( gsl_rng_mt19937 );
XLAL_CHECK_MAIN( r != NULL, XLAL_ESYS );
int nbits = 0;
for ( size_t n = 0; n < XLAL_NUM_ELEM( bits ); ++n ) {
bits[n] = ( gsl_rng_uniform( r ) > 0.44 );
nbits += bits[n] ? 1 : 0;
}
/* Create random index offset into bitset */
const UINT8 n0 = gsl_rng_get( r ) % 65536;
/* Print information */
printf("nbits = %i, n0 = %"LAL_UINT8_FORMAT"\n", nbits, n0);
/* Set bits */
for ( size_t n = 0; n < XLAL_NUM_ELEM( bits ); ++n ) {
XLAL_CHECK_MAIN( XLALBitsetSet( bs, n0 + n, bits[n] ) == XLAL_SUCCESS, XLAL_EFUNC );
}
/* Get bits */
for ( size_t n = 0; n < XLAL_NUM_ELEM( bits ); ++n ) {
BOOLEAN is_set = 0;
XLAL_CHECK_MAIN( XLALBitsetGet( bs, n0 + n, &is_set ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( !is_set == !bits[n], XLAL_EFAILED, "Inconsistent bit at index %"LAL_UINT8_FORMAT": LALBitset=%i, reference=%i", n0 + n, is_set, bits[n] );
}
/* Clear bitset */
XLAL_CHECK_MAIN( XLALBitsetClear( bs ) == XLAL_SUCCESS, XLAL_EFUNC );
for ( size_t n = 0; n < XLAL_NUM_ELEM( bits ); ++n ) {
BOOLEAN is_set = 0;
XLAL_CHECK_MAIN( XLALBitsetGet( bs, n0 + n, &is_set ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( !is_set, XLAL_EFAILED, "Bit still set at index %"LAL_UINT8_FORMAT, n0 + n );
}
/* Cleanup */
gsl_rng_free( r );
XLALBitsetDestroy( bs );
/* Check for memory leaks */
LALCheckMemoryLeaks();
return EXIT_SUCCESS;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:53,代码来源:LALBitsetTest.c
示例13: main
// ==================== function definitions ====================
int main(void)
{
// ---------- test angle conversions ----------
XLAL_CHECK_MAIN ( test_HMS_RAD() == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN ( test_DMS_RAD() == XLAL_SUCCESS, XLAL_EFUNC );
// check for memory leaks
LALCheckMemoryLeaks();
return EXIT_SUCCESS;
} // main()
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:14,代码来源:TranslateAnglesTest.c
示例14: main
/**
* MAIN function
*/
int main(void)
{
XLAL_CHECK ( test_XLALSFTVectorToLFT() == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK ( test_XLALSincInterpolateCOMPLEX8TimeSeries() == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK ( test_XLALSincInterpolateSFT() == XLAL_SUCCESS, XLAL_EFUNC );
LALCheckMemoryLeaks();
return XLAL_SUCCESS;
} /* main() */
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:17,代码来源:LFTandTSutilsTest.c
示例15: main
int main(int argc, char *argv[])
{
const double H0 = 0.72 * LAL_H0FAC_SI; // Hubble's constant in seconds
const double srate = 16384.0; // sampling rate in Hertz
const size_t length = 65536; // number of points in a segment
const size_t stride = length / 2; // number of points in a stride
size_t i, n;
REAL8FrequencySeries *OmegaGW = NULL;
REAL8TimeSeries **seg = NULL;
LIGOTimeGPS epoch;
gsl_rng *rng;
XLALSetErrorHandler(XLALAbortErrorHandler);
parseargs(argc, argv);
XLALGPSSetREAL8(&epoch, tstart);
gsl_rng_env_setup();
rng = gsl_rng_alloc(gsl_rng_default);
OmegaGW = XLALSimSGWBOmegaGWFlatSpectrum(Omega0, flow, srate/length, length/2 + 1);
n = duration * srate;
seg = LALCalloc(numDetectors, sizeof(*seg));
for (i = 0; i < numDetectors; ++i)
seg[i] = XLALCreateREAL8TimeSeries("STRAIN", &epoch, 0.0, 1.0/srate, &lalStrainUnit, length);
XLALSimSGWB(seg, detectors, numDetectors, 0, OmegaGW, H0, rng); // first time to initilize
while (1) { // infinite loop
double t0 = XLALGPSGetREAL8(&seg[0]->epoch);
size_t j;
for (j = 0; j < stride; ++j, --n) { // output first stride points
if (n == 0) // check if we're done
goto end;
printf("%.9f", t0 + j * seg[0]->deltaT);
for (i = 0; i < numDetectors; ++i)
printf("\t%e", seg[i]->data->data[j]);
printf("\n");
}
XLALSimSGWB(seg, detectors, numDetectors, stride, OmegaGW, H0, rng); // make more data
}
end:
for (i = 0; i < numDetectors; ++i)
XLALDestroyREAL8TimeSeries(seg[i]);
XLALFree(seg);
XLALDestroyREAL8FrequencySeries(OmegaGW);
LALCheckMemoryLeaks();
return 0;
}
开发者ID:smirshekari,项目名称:lalsuite,代码行数:50,代码来源:sgwb.c
示例16: testAllocList
/* test to make sure alloc list does what it's supposed to do */
static int testAllocList( void )
{
int keep = lalDebugLevel;
s = malloc( sizeof( *s ) );
XLALClobberDebugLevel(lalDebugLevel | LALMEMDBGBIT | LALMEMTRKBIT);
XLALClobberDebugLevel(lalDebugLevel & ~LALMEMPADBIT);
/* empty allocation list */
trial( LALCheckMemoryLeaks(), 0, "" );
trial( LALFree( s ), SIGSEGV, "not found" );
/* can't find allocation in PopAlloc */
trial( p = LALMalloc( 2 * sizeof( *p ) ), 0, "" );
trial( q = LALMalloc( 4 * sizeof( *q ) ), 0, "" );
trial( r = LALMalloc( 8 * sizeof( *r ) ), 0, "" );
trial( LALFree( s ), SIGSEGV, "not found" );
trial( LALFree( p ), 0, "" );
trial( LALFree( r ), 0, "" );
trial( LALCheckMemoryLeaks(), SIGSEGV, "memory leak" );
trial( LALFree( q ), 0, "" );
trial( LALCheckMemoryLeaks(), 0, "" );
/* can't find allocation in ModAlloc */
/* For some reason this next test fails on Snow Leopard... */
/* trial( s = LALRealloc( s, 1024 ), SIGSEGV, "not found" ); */
trial( p = LALRealloc( NULL, 2 * sizeof( *p ) ), 0, "" );
/* trial( s = LALRealloc( s, 1024 ), SIGSEGV, "not found" ); */
trial( LALFree( p ), 0, "" );
trial( LALCheckMemoryLeaks(), 0, "" );
free( s );
XLALClobberDebugLevel(keep);
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:37,代码来源:LALMallocTest.c
示例17: main
// ==================== function definitions ====================
int main(void)
{
// ---------- test various string-value parser functions ----------
XLAL_CHECK_MAIN ( test_ParseStringValue() == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN ( test_ParseStringVector() == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN ( test_ParseREAL8Vector() == XLAL_SUCCESS, XLAL_EFUNC );
// check for memory leaks
LALCheckMemoryLeaks();
return EXIT_SUCCESS;
} // main()
开发者ID:astrophysicsvivien,项目名称:lalsuite,代码行数:16,代码来源:UserInputParseTest.c
示例18: main
int main (void) {
static REAL4Vector *signal1;
static LALStatus status;
static InspiralTemplate params;
static REAL8 dt;
UINT4 n;
params.OmegaS = 0.;
params.Theta = 0.;
params.ieta=1;
params.mass1=5.1;
params.mass2=5.;
params.startTime=0.0;
params.startPhase=0.0;
params.fLower=40.0;
params.fCutoff=2048.00;
params.tSampling=8192.0;
params.order=6;
params.approximant=IMRPhenomB;
/* SpinTaylorT3 */
params.signalAmplitude=1.0;
params.nStartPad=0;
params.nEndPad=0;
params.massChoice=m1Andm2;
params.distance = 100.;
dt = 1./params.tSampling;
params.spin1[2]=1.0;
params.spin2[2]=0.99;
LALInspiralWaveLength(&status, &n, params);
LALInspiralParameterCalc(&status, ¶ms);
fprintf(stderr, "Testing Inspiral Signal Generation Codes:\n");
fprintf(stderr, "Signal length=%d, m1=%e, m2=%e, fLower=%e, fUpper=%e\n",
n, params.mass1, params.mass2, params.fLower, params.fCutoff);
LALCreateVector(&status, &signal1, n);
LALInspiralWave(&status, signal1, ¶ms);
fprintf(stderr,"fFinal = %e\n", params.fFinal);
printf_timeseries(signal1->length, signal1->data, dt, params.startTime);
REPORTSTATUS(&status);
printf("duration is %f \n", params.tC);
printf("final frequency is %f \n", params.fFinal);
LALDestroyVector(&status, &signal1);
LALCheckMemoryLeaks();
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:48,代码来源:LALInspiralTest.c
示例19: FreeMem
int FreeMem(void)
{
LALFrClose(&status,&framestream);
LALDestroyVector(&status,&darm.data);
LALDestroyVector(&status,&exc.data);
LALDestroyVector(&status,&asq.data);
LALDestroyVector(&status,&asqwin);
LALDestroyVector(&status,&darmwin);
LALDestroyVector(&status,&excwin);
LALCheckMemoryLeaks();
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:17,代码来源:ComputeCalibrationFactorsTest.c
示例20: main
int main(void)
{
XLALSetErrorHandler(XLALAbortErrorHandler);
test_CHARVector();
test_INT2Vector();
test_INT4Vector();
test_INT8Vector();
test_UINT2Vector();
test_UINT4Vector();
test_UINT8Vector();
test_REAL4Vector();
test_REAL8Vector();
test_COMPLEX8Vector();
test_COMPLEX16Vector();
test_INT2Array();
test_INT4Array();
test_INT8Array();
test_UINT2Array();
test_UINT4Array();
test_UINT8Array();
test_REAL4Array();
test_REAL8Array();
test_COMPLEX8Array();
test_COMPLEX16Array();
test_INT2TimeSeries();
test_INT4TimeSeries();
test_INT8TimeSeries();
test_UINT2TimeSeries();
test_UINT4TimeSeries();
test_UINT8TimeSeries();
test_REAL4TimeSeries();
test_REAL8TimeSeries();
test_COMPLEX8TimeSeries();
test_COMPLEX16TimeSeries();
test_REAL4FrequencySeries();
test_REAL8FrequencySeries();
test_COMPLEX8FrequencySeries();
test_COMPLEX16FrequencySeries();
LALCheckMemoryLeaks();
return 0;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:46,代码来源:H5FileIOTest.c
注:本文中的LALCheckMemoryLeaks函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论