+2010-05-07 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * libgfortran.h (free_mem): Remove prototype.
+ * runtime/memory.c (free_mem): Remove function.
+ * intrinsics/date_and_time.c (secnds): Replace free_mem() with
+ free().
+ * io/fbuf.c (fbuf_destroy): Likewise.
+ * io/format.c (free_format_hash_table): Likewise.
+ (save_parsed_format): Likewise.
+ (free_format_data): Likewise.
+ * io/list_read.c (free_saved): Likewise.
+ (free_line): Likewise.
+ (nml_touch_nodes): Likewise.
+ (nml_read_obj): Likewise
+ * io/lock.c (free_ionml): Likewise.
+ * io/open.c (new_unit): Likewise.
+ (already_open): Likewise.
+ * io/unit.c (destroy_unit_mutex): Likewise.
+ (free_internal_unit): Likewise.
+ (close_unit_1): Likewise.
+ * io/unix.c (raw_close): Likewise.
+ (buf_close): Likewise.
+ (mem_close): Likewise.
+ (tempfile): Likewise.
+ * io/write.c (nml_write_obj): Likewise.
+ * io/write_float.def (output_float_FMT_G_##): Likewise.
+ * runtime/error.c (show_locus): Likewise.
+
2010-05-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR other/43620
Free Software Foundation, Inc.
Contributed by Steven Bosscher.
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
date_and_time (NULL, NULL, NULL, avalues, 0, 0, 0);
- free_mem (avalues);
+ free (avalues);
temp1 = 3600.0 * (GFC_REAL_4)values[4] +
60.0 * (GFC_REAL_4)values[5] +
-/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Janne Blomqvist
This file is part of the GNU Fortran runtime library (libgfortran).
if (u->fbuf == NULL)
return;
if (u->fbuf->buf)
- free_mem (u->fbuf->buf);
- free_mem (u->fbuf);
+ free (u->fbuf->buf);
+ free (u->fbuf);
u->fbuf = NULL;
}
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
+#include <stdlib.h>
#define FARRAY_SIZE 64
if (u->format_hash_table[i].hashed_fmt != NULL)
{
free_format_data (u->format_hash_table[i].hashed_fmt);
- free_mem (u->format_hash_table[i].key);
+ free (u->format_hash_table[i].key);
}
u->format_hash_table[i].key = NULL;
u->format_hash_table[i].key_len = 0;
u->format_hash_table[hash].hashed_fmt = NULL;
if (u->format_hash_table[hash].key != NULL)
- free_mem (u->format_hash_table[hash].key);
+ free (u->format_hash_table[hash].key);
u->format_hash_table[hash].key = get_mem (dtp->format_len);
memcpy (u->format_hash_table[hash].key, dtp->format, dtp->format_len);
for (fa = fmt->array.next; fa; fa = fa_next)
{
fa_next = fa->next;
- free_mem (fa);
+ free (fa);
}
- free_mem (fmt);
+ free (fmt);
fmt = NULL;
}
Namelist input contributed by Paul Thomas
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (dtp->u.p.saved_string == NULL)
return;
- free_mem (dtp->u.p.saved_string);
+ free (dtp->u.p.saved_string);
dtp->u.p.saved_string = NULL;
dtp->u.p.saved_used = 0;
if (dtp->u.p.line_buffer == NULL)
return;
- free_mem (dtp->u.p.line_buffer);
+ free (dtp->u.p.line_buffer);
dtp->u.p.line_buffer = NULL;
}
else
break;
}
- free_mem (ext_name);
+ free (ext_name);
return;
}
pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh) == FAILURE)
{
- free_mem (obj_name);
+ free (obj_name);
return FAILURE;
}
if (dtp->u.p.input_complete)
{
- free_mem (obj_name);
+ free (obj_name);
return SUCCESS;
}
}
- free_mem (obj_name);
+ free (obj_name);
goto incr_idx;
default:
/* Thread/recursion locking
- Copyright 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org> and Andy Vaught
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
#include "io.h"
#include <string.h>
+#include <stdlib.h>
/* library_start()-- Called with a library call is entered. */
{
t2 = t1;
t1 = t1->next;
- free_mem (t2->var_name);
+ free (t2->var_name);
if (t2->var_rank)
{
- free_mem (t2->dim);
- free_mem (t2->ls);
+ free (t2->dim);
+ free (t2->ls);
}
- free_mem (t2);
+ free (t2);
}
}
dtp->u.p.ionml = NULL;
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
static const st_option access_opt[] = {
test_endfile (u);
if (flags->status == STATUS_SCRATCH && opp->file != NULL)
- free_mem (opp->file);
+ free (opp->file);
if (flags->form == FORM_FORMATTED)
{
/* Free memory associated with a temporary filename. */
if (flags->status == STATUS_SCRATCH && opp->file != NULL)
- free_mem (opp->file);
+ free (opp->file);
fail:
u->s = NULL;
if (u->file)
- free_mem (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
-/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
destroy_unit_mutex (gfc_unit * u)
{
__gthread_mutex_destroy (&u->lock);
- free_mem (u);
+ free (u);
}
if (dtp->u.p.current_unit != NULL)
{
if (dtp->u.p.current_unit->ls != NULL)
- free_mem (dtp->u.p.current_unit->ls);
+ free (dtp->u.p.current_unit->ls);
if (dtp->u.p.current_unit->s)
- free_mem (dtp->u.p.current_unit->s);
+ free (dtp->u.p.current_unit->s);
destroy_unit_mutex (dtp->u.p.current_unit);
}
delete_unit (u);
if (u->file)
- free_mem (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
retval = close (s->fd);
else
retval = 0;
- free_mem (s);
+ free (s);
return retval;
}
{
if (buf_flush (s) != 0)
return -1;
- free_mem (s->buffer);
+ free (s->buffer);
return raw_close (s);
}
mem_close (unix_stream * s)
{
if (s != NULL)
- free_mem (s);
+ free (s);
return 0;
}
#endif /* HAVE_MKSTEMP */
if (fd < 0)
- free_mem (template);
+ free (template);
else
{
opp->file = template;
__gthread_mutex_lock (&unit_lock);
__gthread_mutex_unlock (&u->lock);
if (predec_waiting_locked (u) == 0)
- free_mem (u);
+ free (u);
goto retry;
}
__gthread_mutex_lock (&unit_lock);
__gthread_mutex_unlock (&u->lock);
if (predec_waiting_locked (u) == 0)
- free_mem (u);
+ free (u);
}
}
while (1);
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
Namelist output contributed by Paul Thomas
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
obj, ext_name);
}
- free_mem (obj_name);
- free_mem (ext_name);
+ free (obj_name);
+ free (ext_name);
goto obj_loop;
default:
Write float code factoring to this file by Jerry DeLisle
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
edigits);\
dtp->u.p.scale_factor = save_scale_factor;\
\
- free_mem(newf);\
+ free (newf);\
\
if (nb > 0 && !dtp->u.p.g0_no_blanks)\
{ \
Contributed by Paul Brook <paul@nowt.org>, and
Andy Vaught <andy@xena.eas.asu.edu>
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern void *get_mem (size_t) __attribute__ ((malloc));
internal_proto(get_mem);
-extern void free_mem (void *);
-internal_proto(free_mem);
-
extern void *internal_malloc_size (size_t) __attribute__ ((malloc));
internal_proto(internal_malloc_size);
Free Software Foundation, Inc.
Contributed by Andy Vaught
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
st_printf ("At line %d of file %s (unit = %d, file = '%s')\n",
(int) cmp->line, cmp->filename, (int) cmp->unit, filename);
- free_mem (filename);
+ free (filename);
}
else
{
/* Memory management routines.
- Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright 2002, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
}
-void
-free_mem (void *p)
-{
- free (p);
-}
-
-
/* Allocate memory for internal (compiler generated) use. */
void *