File tree Expand file tree Collapse file tree 20 files changed +194
-10
lines changed Expand file tree Collapse file tree 20 files changed +194
-10
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ add_proxy_header_library(
81
81
libc.include.signal
82
82
)
83
83
84
+ add_header_library (stdlib_overlay HDRS stdlib_overlay.h )
85
+
84
86
add_proxy_header_library (
85
87
stdlib_macros
86
88
HDRS
@@ -193,3 +195,4 @@ add_proxy_header_library(
193
195
)
194
196
195
197
add_subdirectory (types )
198
+ add_subdirectory (func )
Original file line number Diff line number Diff line change
1
+ add_proxy_header_library (
2
+ aligned_alloc
3
+ HDRS
4
+ aligned_alloc.h
5
+ DEPENDS
6
+ libc.hdr.stdlib_overlay
7
+ FULL_BUILD_DEPENDS
8
+ libc.include.stdlib
9
+ libc.hdr.types.size_t
10
+ )
11
+
12
+ add_proxy_header_library (
13
+ malloc
14
+ HDRS
15
+ malloc.h
16
+ DEPENDS
17
+ libc.hdr.stdlib_overlay
18
+ FULL_BUILD_DEPENDS
19
+ libc.include.stdlib
20
+ libc.hdr.types.size_t
21
+ )
22
+
23
+ add_proxy_header_library (
24
+ realloc
25
+ HDRS
26
+ realloc.h
27
+ DEPENDS
28
+ libc.hdr.stdlib_overlay
29
+ FULL_BUILD_DEPENDS
30
+ libc.include.stdlib
31
+ libc.hdr.types.size_t
32
+ )
33
+
34
+ add_proxy_header_library (
35
+ free
36
+ HDRS
37
+ free.h
38
+ DEPENDS
39
+ libc.hdr.stdlib_overlay
40
+ FULL_BUILD_DEPENDS
41
+ libc.include.stdlib
42
+ )
43
+
44
+ add_proxy_header_library (
45
+ _Exit
46
+ HDRS
47
+ _Exit.h
48
+ DEPENDS
49
+ libc.hdr.stdlib_overlay
50
+ FULL_BUILD_DEPENDS
51
+ libc.include.stdlib
52
+ )
Original file line number Diff line number Diff line change
1
+ //===-- Definition of the _Exit proxy -------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_FUNC_EXIT_H
10
+ #define LLVM_LIBC_HDR_FUNC_EXIT_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+ extern "C" void _Exit (int );
14
+
15
+ #else // Overlay mode
16
+
17
+ #include "hdr/stdlib_overlay.h"
18
+
19
+ #endif
20
+
21
+ #endif // LLVM_LIBC_HDR_EXIT_H
Original file line number Diff line number Diff line change
1
+ //===-- Definition of the aligned_alloc.h proxy ---------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_FUNC_ALIGNED_ALLOC_H
10
+ #define LLVM_LIBC_HDR_FUNC_ALIGNED_ALLOC_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+ #include "hdr/types/size_t.h"
14
+ extern "C" void * aligned_alloc (size_t , size_t );
15
+
16
+ #else // Overlay mode
17
+
18
+ #include "hdr/stdlib_overlay.h"
19
+
20
+ #endif
21
+
22
+ #endif
Original file line number Diff line number Diff line change
1
+ //===-- Definition of the free.h proxy ------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_FUNC_FREE_H
10
+ #define LLVM_LIBC_HDR_FUNC_FREE_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+ extern "C" void free (void * );
14
+
15
+ #else // Overlay mode
16
+
17
+ #include "hdr/stdlib_overlay.h"
18
+
19
+ #endif
20
+
21
+ #endif
Original file line number Diff line number Diff line change
1
+ //===-- Definition of the malloc.h proxy ----------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_FUNC_MALLOC_H
10
+ #define LLVM_LIBC_HDR_FUNC_MALLOC_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+ #include "hdr/types/size_t.h"
14
+ extern "C" void * malloc (size_t );
15
+
16
+ #else // Overlay mode
17
+
18
+ #include "hdr/stdlib_overlay.h"
19
+
20
+ #endif
21
+
22
+ #endif
Original file line number Diff line number Diff line change
1
+ //===-- Definition of the realloc.h proxy ---------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_FUNC_REALLOC_H
10
+ #define LLVM_LIBC_HDR_FUNC_REALLOC_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+ #include "hdr/types/size_t.h"
14
+ extern "C" void * realloc (void * ptr , size_t new_size );
15
+
16
+ #else // Overlay mode
17
+
18
+ #include "hdr/stdlib_overlay.h"
19
+
20
+ #endif
21
+
22
+ #endif
Original file line number Diff line number Diff line change @@ -242,6 +242,9 @@ add_header_library(
242
242
HDRS
243
243
char_vector.h
244
244
DEPENDS
245
+ libc.hdr.func.free
246
+ libc.hdr.func.malloc
247
+ libc.hdr.func.realloc
245
248
libc.src.__support.common
246
249
)
247
250
Original file line number Diff line number Diff line change @@ -80,8 +80,10 @@ add_header_library(
80
80
HDRS
81
81
string .h
82
82
DEPENDS
83
- libc.include.stdlib
84
83
.string_view
84
+ libc.hdr.func.free
85
+ libc.hdr.func.malloc
86
+ libc.hdr.func.realloc
85
87
libc.src.__support.common
86
88
libc.src.__support.integer_to_string
87
89
libc.src.string.memory_utils.inline_memcpy
@@ -199,7 +201,9 @@ add_object_library(
199
201
HDRS
200
202
new.h
201
203
DEPENDS
202
- libc.include.stdlib
204
+ libc.hdr.func.free
205
+ libc.hdr.func.malloc
206
+ libc.hdr.func.aligned_alloc
203
207
libc.src.__support.common
204
208
libc.src.__support.macros.properties.os
205
209
)
Original file line number Diff line number Diff line change 7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " new.h"
10
- #include < stdlib.h > // For free, etc
10
+ #include " hdr/func/ free.h "
11
11
12
12
void operator delete (void *mem) noexcept { ::free (mem); }
13
13
You can’t perform that action at this time.
0 commit comments