1 /*
2 Copyright (c) 1994 Cygnus Support.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms are permitted
6 provided that the above copyright notice and this paragraph are
7 duplicated in all such forms and that any documentation,
8 and/or other materials related to such
9 distribution and use acknowledge that the software was developed
10 at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
11 endorse or promote products derived from this software without
12 specific prior written permission.
13 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17 /*
18 FUNCTION
19 	<<reent>>---definition of impure data.
20 
21 INDEX
22 	reent
23 
24 DESCRIPTION
25 	This module defines the impure data area used by the
26 	non-reentrant functions, such as strtok.
27 */
28 
29 #define _DEFAULT_SOURCE
30 
31 #include <stdlib.h>
32 #ifndef TINY_STDIO
33 #include "../stdio/local.h"
34 #endif
35 
36 void
_reclaim_reent(void * ptr)37 _reclaim_reent (void *ptr)
38 {
39   (void) ptr;
40 #ifndef _REENT_THREAD_LOCAL
41   if (ptr != _impure_ptr)
42 #endif
43     {
44 #ifndef TINY_STDIO
45       if (_REENT_CLEANUP(ptr))
46 	{
47 	  /* cleanup won't reclaim memory 'coz usually it's run
48 	     before the program exits, and who wants to wait for that? */
49 	  _REENT_CLEANUP(ptr) ();
50 	}
51 #endif
52       /* Malloc memory not reclaimed; no good way to return memory anyway. */
53 
54     }
55 }
56