diff options
Diffstat (limited to 'newlib/libc/reent/reent.c')
-rw-r--r-- | newlib/libc/reent/reent.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c index ddf6a8267..f35d95711 100644 --- a/newlib/libc/reent/reent.c +++ b/newlib/libc/reent/reent.c @@ -30,9 +30,9 @@ int errno; /* Interim cleanup code */ void -_DEFUN (cleanup_glue, (ptr, glue), - struct _reent *ptr _AND - struct _glue *glue) +cleanup_glue (ptr, glue) + struct _reent *ptr; + struct _glue *glue; { /* Have to reclaim these in reverse order: */ if (glue->_next) @@ -42,23 +42,20 @@ _DEFUN (cleanup_glue, (ptr, glue), } void -_DEFUN (_reclaim_reent, (ptr), - struct _reent *ptr) +_reclaim_reent (ptr) + struct _reent *ptr; { if (ptr != _impure_ptr) { /* used by mprec routines. */ -#ifdef _REENT_SMALL - if (ptr->_mp) /* don't bother allocating it! */ -#endif - if (_REENT_MP_FREELIST(ptr)) + if (ptr->_freelist) { int i; for (i = 0; i < 15 /* _Kmax */; i++) { struct _Bigint *thisone, *nextone; - nextone = _REENT_MP_FREELIST(ptr)[i]; + nextone = ptr->_freelist[i]; while (nextone) { thisone = nextone; @@ -67,23 +64,9 @@ _DEFUN (_reclaim_reent, (ptr), } } - _free_r (ptr, _REENT_MP_FREELIST(ptr)); + _free_r (ptr, ptr->_freelist); } -#ifdef _REENT_SMALL - if (ptr->_emergency) - _free_r (ptr, ptr->_emergency); - if (ptr->_mp) - _free_r (ptr, ptr->_mp); - if (ptr->_r48) - _free_r (ptr, ptr->_r48); - if (ptr->_localtime_buf) - _free_r (ptr, ptr->_localtime_buf); - if (ptr->_asctime_buf) - _free_r (ptr, ptr->_asctime_buf); - if (ptr->_atexit->_on_exit_args_ptr) - _free_r (ptr, ptr->_atexit->_on_exit_args_ptr); -#else /* atexit stuff */ if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0)) { @@ -95,7 +78,6 @@ _DEFUN (_reclaim_reent, (ptr), _free_r (ptr, q); } } -#endif if (ptr->_cvtbuf) _free_r (ptr, ptr->_cvtbuf); @@ -123,7 +105,7 @@ _DEFUN (_reclaim_reent, (ptr), */ void -_DEFUN (_wrapup_reent, (ptr), struct _reent *ptr) +_wrapup_reent(struct _reent *ptr) { register struct _atexit *p; register int n; @@ -131,14 +113,9 @@ _DEFUN (_wrapup_reent, (ptr), struct _reent *ptr) if (ptr == 0) ptr = _REENT; -#ifdef _REENT_SMALL - for (p = &ptr->_atexit, n = p->_ind; --n >= 0;) - (*p->_fns[n]) (); -#else for (p = ptr->_atexit; p; p = p->_next) for (n = p->_ind; --n >= 0;) (*p->_fns[n]) (); -#endif if (ptr->__cleanup) (*ptr->__cleanup) (ptr); } |