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