help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] glp_main


From: Andrew Makhorin
Subject: Re: [Help-glpk] glp_main
Date: Wed, 09 Nov 2011 03:20:23 +0300

> Should the following code cause glpk to loose its blocks?
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include "glpk.h"
> 
> 
> int main(void)
> { 
>     glp_prob *lp;
>     char *com[2];
>     
>     lp = glp_create_prob();
>     
>     com[0] = "glpsol";
>     com[1] = "--version";
>     
>     glp_main(2, (const char**)com);
>     return 0;
> }
> 
> The output is:
> 
> GLPSOL: GLPK LP/MIP Solver, v4.47
> 
> Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
> 2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics,
> Moscow Aviation Institute, Moscow, Russia. All rights reserved.
> 
> This program has ABSOLUTELY NO WARRANTY.
> 
> This program is free software; you may re-distribute it under the terms
> of the GNU General Public License version 3 or later.
> Error: 5 memory block(s) were lost
> Error detected in file
> ../../../../../msys/home/Nigel/glpk-4.47/src/glpapi21.c at line 1314
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> RUN FAILED (exit value 3, total time: 4s)
> 

Glp_main is a undocumented api routine. It is used just to provide
possibility for building glpsol as a glpk-based application (with make),
because glpsol calls uses internal non-api routines and data structures
not declared in glpk.h.

No memory blocks are lost, however, glp_main assumes that all memory
allocations are performed within it, so if it detects that some blocks
are still allocated on exit, it reports the error.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]