OLD | NEW |
| (Empty) |
1 /* | |
2 Samba trivial allocation library - compat functions | |
3 | |
4 Copyright (C) Stefan Metzmacher 2009 | |
5 | |
6 ** NOTE! The following LGPL license applies to the talloc | |
7 ** library. This does NOT imply that all of Samba is released | |
8 ** under the LGPL | |
9 | |
10 This library is free software; you can redistribute it and/or | |
11 modify it under the terms of the GNU Lesser General Public | |
12 License as published by the Free Software Foundation; either | |
13 version 3 of the License, or (at your option) any later version. | |
14 | |
15 This library is distributed in the hope that it will be useful, | |
16 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 Lesser General Public License for more details. | |
19 | |
20 You should have received a copy of the GNU Lesser General Public | |
21 License along with this library; if not, see <http://www.gnu.org/licenses/>. | |
22 */ | |
23 | |
24 /* | |
25 * This file contains only function to build a | |
26 * compat talloc.so.1 library on top of talloc.so.2 | |
27 */ | |
28 | |
29 #include "replace.h" | |
30 #include "talloc.h" | |
31 | |
32 void *_talloc_reference(const void *context, const void *ptr); | |
33 void *_talloc_reference(const void *context, const void *ptr) { | |
34 return _talloc_reference_loc(context, ptr, | |
35 "Called from talloc compat1 " | |
36 "_talloc_reference"); | |
37 } | |
38 | |
39 void *_talloc_steal(const void *new_ctx, const void *ptr); | |
40 void *_talloc_steal(const void *new_ctx, const void *ptr) | |
41 { | |
42 return talloc_reparent(talloc_parent(ptr), new_ctx, ptr); | |
43 } | |
44 | |
45 #undef talloc_free | |
46 int talloc_free(void *ptr); | |
47 int talloc_free(void *ptr) | |
48 { | |
49 return talloc_unlink(talloc_parent(ptr), ptr); | |
50 } | |
51 | |
OLD | NEW |