diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-14 19:33:57 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-14 19:33:57 +0000 |
commit | 9915365eaddf007c2fff0945552fbd69c4597968 (patch) | |
tree | 4a299e8ff3b7b281e17a2e8950d235983d8b4c7a /libgfortran/runtime | |
parent | 1bfb5669d2036c938851c85da4431d38fef945c8 (diff) | |
download | gcc-9915365eaddf007c2fff0945552fbd69c4597968.tar.gz |
PR fortran/30723
* trans.h (gfor_fndecl_internal_malloc, gfor_fndecl_internal_malloc64,
gfor_fndecl_internal_free): Remove prototypes.
(gfor_fndecl_os_error, gfc_call_free, gfc_call_malloc): Add prototypes.
* trans.c (gfc_call_malloc, gfc_call_free): New functions.
* f95-lang.c (gfc_init_builtin_functions): Add __builtin_free
and __builtin_malloc builtins.
* trans-decl.c (gfor_fndecl_internal_malloc,
gfor_fndecl_internal_malloc64, gfor_fndecl_internal_free): Remove.
(gfor_fndecl_os_error): Add.
(gfc_build_builtin_function_decls): Don't create internal_malloc,
internal_malloc64 and internal_free library function declaration.
Create os_error library call function declaration.
* trans-array.c (gfc_trans_allocate_array_storage,
gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
gfc_conv_array_parameter, gfc_duplicate_allocatable): Use
gfc_call_malloc and gfc_call_free instead of building calls to
internal_malloc and internal_free.
* trans-expr.c (gfc_conv_string_tmp): Likewise.
* trans-stmt.c (gfc_do_allocate, gfc_trans_assign_need_temp,
gfc_trans_pointer_assign_need_temp, gfc_trans_forall_1,
gfc_trans_where_2: Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_trim): Likewise.
* runtime/memory.c (internal_malloc, internal_malloc64,
internal_free): Remove.
* runtime/error.c (os_error): Export function.
* intrinsics/move_alloc.c: Include stdlib.h.
(move_alloc): Call free instead of internal_free.
(move_alloc_c): Wrap long lines.
* libgfortran.h (os_error): Export prototype.
(internal_free): Remove prototype.
* gfortran.map (GFORTRAN_1.0): Remove _gfortran_internal_free,
_gfortran_internal_malloc and _gfortran_internal_malloc64.
Add _gfortran_os_error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124721 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/error.c | 1 | ||||
-rw-r--r-- | libgfortran/runtime/memory.c | 40 |
2 files changed, 1 insertions, 40 deletions
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 2bcc293091a..bd3c306bc2f 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -285,6 +285,7 @@ os_error (const char *message) st_printf ("Operating system error: %s\n%s\n", get_oserror (), message); sys_exit (1); } +iexport(os_error); /* void runtime_error()-- These are errors associated with an diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c index 58395303440..fe76675c9ad 100644 --- a/libgfortran/runtime/memory.c +++ b/libgfortran/runtime/memory.c @@ -77,46 +77,6 @@ internal_malloc_size (size_t size) return get_mem (size); } -extern void *internal_malloc (GFC_INTEGER_4); -export_proto(internal_malloc); - -void * -internal_malloc (GFC_INTEGER_4 size) -{ -#ifdef GFC_CHECK_MEMORY - /* Under normal circumstances, this is _never_ going to happen! */ - if (size < 0) - runtime_error ("Attempt to allocate a negative amount of memory."); - -#endif - return internal_malloc_size ((size_t) size); -} - -extern void *internal_malloc64 (GFC_INTEGER_8); -export_proto(internal_malloc64); - -void * -internal_malloc64 (GFC_INTEGER_8 size) -{ -#ifdef GFC_CHECK_MEMORY - /* Under normal circumstances, this is _never_ going to happen! */ - if (size < 0) - runtime_error ("Attempt to allocate a negative amount of memory."); -#endif - return internal_malloc_size ((size_t) size); -} - - -/* Free internally allocated memory. Pointer is NULLified. Also used to - free user allocated memory. */ - -void -internal_free (void *mem) -{ - if (mem != NULL) - free (mem); -} -iexport(internal_free); /* Reallocate internal memory MEM so it has SIZE bytes of data. Allocate a new block if MEM is zero, and free the block if |