help-gsl
[Top][All Lists]
Advanced

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

free (was: [Help-gsl] Help with GSL Matrices)


From: Jochen Küpper
Subject: free (was: [Help-gsl] Help with GSL Matrices)
Date: Sun, 11 Jun 2006 18:15:13 +0200

John D Lamb <address@hidden> writes:

> gsl_matrix_alloc and gsl_matrix free behave like alloc and free and
> so I guess gsl_matrix_alloc returns 0 on failure and gsl_matrix_free
> should not be called with a null pointer.

Actually it should be ok to call free with NULL, just not with any
other invalid pointer:

,----[man free]
|      free()  frees the  memory space  pointed to  by ptr,  which must  have 
been
|      returned by a previous call to malloc(), calloc() or realloc().  
Otherwise,
|      or if free(ptr) has already been called before, undefined behaviour 
occurs.
|      If ptr is NULL, no operation is performed.
`----

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)




reply via email to

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