]> www.ginac.de Git - cln.git/blob - src/base/cl_free.cc
Initial revision
[cln.git] / src / base / cl_free.cc
1 // cl_free_heap_object().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_object.h"
8
9
10 // Implementation.
11
12 #include "cl_malloc.h"
13
14 void cl_free_heap_object (cl_heap* pointer)
15 {
16         // This is invoked when pointer->refcount gets decremented to 0.
17         var const cl_class* type = pointer->type;
18         if (type->destruct)
19                 type->destruct(pointer);
20         cl_free_hook(pointer);
21 }
22
23
24 // The best place to put the free software license is cl_free.o.
25
26 // NB about #ident: To see the strings in the .comment section of an ELF
27 // executable, use "strings < executable", not "strings executable".
28 // Better put the license into the data section: it is more portable (some
29 // C++ compilers may not understand #ident), is not lost in object formats
30 // like a.out, and is taken into account by "intelligent" strings commands.
31
32 static const char * copyright_notice[] = {
33   "                                                                    \n"
34   "Copyright (c) Bruno Haible 1988-1999                                \n"
35   "                                                                    \n"
36   "This program is free software; you can redistribute it and/or modify\n"
37   "it under the terms of the GNU General Public License as published by\n"
38   "the Free Software Foundation; either version 2, or (at your option) \n"
39   "any later version.                                                  \n"
40   "                                                                    \n"
41   "This program is distributed in the hope that it will be useful, but \n"
42   "WITHOUT ANY WARRANTY; without even the implied warranty of          \n"
43   "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   \n"
44   "General Public License for more details.                            \n"
45   "                                                                    \n"
46   "You should have received a copy of the GNU General Public License   \n"
47   "along with this program; if not, write to the Free Software         \n"
48   "Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
49   "                                                                    ",
50   (const char *) &copyright_notice
51 };