Skip to content

Commit b63396b

Browse files
committed
allocators: move standard allocator into subdirectory
Right now, our two allocator implementations are scattered around the tree in "stdalloc.h" and "win32/w32_crtdbg_stacktrace.h". Start grouping them together in a single directory "allocators/", similar to how e.g. our streams are organized.
1 parent 9eb098d commit b63396b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ ELSE()
428428
FILE(GLOB SRC_OS unix/*.c unix/*.h)
429429
ENDIF()
430430
FILE(GLOB SRC_GIT2 *.c *.h
431+
allocators/*.c allocators/*.h
431432
streams/*.c streams/*.h
432433
transports/*.c transports/*.h
433434
xdiff/*.c xdiff/*.h)

src/alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#if defined(GIT_MSVC_CRTDBG)
1111
# include "win32/w32_crtdbg_stacktrace.h"
1212
#else
13-
# include "stdalloc.h"
13+
# include "allocators/stdalloc.h"
1414
#endif
1515

1616
git_allocator git__allocator;

src/stdalloc.h renamed to src/allocators/stdalloc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* a Linking Exception. For full terms see the included COPYING file.
66
*/
77

8-
#ifndef INCLUDE_stdalloc_h__
9-
#define INCLUDE_stdalloc_h__
10-
11-
#include "alloc.h"
8+
#ifndef INCLUDE_allocators_stdalloc_h__
9+
#define INCLUDE_allocators_stdalloc_h__
1210

1311
#include "common.h"
1412

13+
#include "alloc.h"
14+
1515
int git_stdalloc_init_allocator(git_allocator *allocator);
1616

1717
#endif

0 commit comments

Comments
 (0)