Skip to content

Commit a9f6c78

Browse files
Remove usage of crtdbg in favor of anyhow using VLD
1 parent 6b0f668 commit a9f6c78

37 files changed

+323
-653
lines changed

Diff for: CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF)
4040
option(run_longhaul_tests "set run_longhaul_tests to ON to run longhaul tests (default is OFF)[if possible, they are always built]" OFF)
4141
option(run_unittests "set run_unittests to ON to run unittests (default is OFF)" OFF)
4242
option(skip_samples "set skip_samples to ON to skip building samples (default is OFF)[if possible, they are always built]" OFF)
43-
option(leak_detection "set leak_detection to ON (default is OFF)" OFF)
4443
option(compileOption_C "passes a string to the command line of the C compiler" OFF)
4544
option(compileOption_CXX "passes a string to the command line of the C++ compiler" OFF)
4645
option(use_wsio "set use_wsio to ON to use libwebsockets for WebSocket support (default is OFF)" OFF)
@@ -141,10 +140,6 @@ include_directories(${CMAKE_CURRENT_LIST_DIR}/inc ${SHARED_UTIL_INC_FOLDER})
141140

142141
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
143142

144-
if(${leak_detection})
145-
add_definitions(-D_CRTDBG_MAP_ALLOC)
146-
endif()
147-
148143
if(${memory_trace})
149144
else()
150145
add_definitions(-DDISABLE_MEMORY_TRACE)

Diff for: c-utility

Submodule c-utility updated 130 files

Diff for: mbed/tcpsocketconnection_c.cpp

-89
This file was deleted.

Diff for: mbed/tcpsocketconnection_c.h

-25
This file was deleted.

Diff for: mbed/tickcounter.c

-61
This file was deleted.

Diff for: mbed/tickcounter.h

-27
This file was deleted.

Diff for: samples/eh_sender_with_sas_token_sample/main.c

-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
85
#include <stdio.h>
96
#include <stdbool.h>
107
#include <time.h>
@@ -235,9 +232,5 @@ int main(int argc, char** argv)
235232
result = 0;
236233
}
237234

238-
#ifdef _CRTDBG_MAP_ALLOC
239-
_CrtDumpMemoryLeaks();
240-
#endif
241-
242235
return result;
243236
}

Diff for: samples/local_client_sample/main.c

-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
85
#include <stdio.h>
96
#include <stdbool.h>
107
#include "azure_c_shared_utility/platform.h"
@@ -136,9 +133,5 @@ int main(int argc, char** argv)
136133
result = 0;
137134
}
138135

139-
#ifdef _CRTDBG_MAP_ALLOC
140-
_CrtDumpMemoryLeaks();
141-
#endif
142-
143136
return result;
144137
}

Diff for: samples/local_server_sample/main.c

-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
85
#include <stdio.h>
96
#include <stdbool.h>
107
#include "azure_c_shared_utility/platform.h"
@@ -128,9 +125,5 @@ int main(int argc, char** argv)
128125
printf("Current memory usage:%lu\r\n", (unsigned long)amqpalloc_get_current_memory_used());
129126
}
130127

131-
#ifdef _CRTDBG_MAP_ALLOC
132-
_CrtDumpMemoryLeaks();
133-
#endif
134-
135128
return result;
136129
}

Diff for: samples/message_receiver_sample/main.c

-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
8-
95
#include <stdio.h>
106
#include <stdbool.h>
117
#include "azure_c_shared_utility/platform.h"
@@ -125,10 +121,6 @@ int main(int argc, char** argv)
125121

126122
(void)printf("Max memory usage:%lu\r\n", (unsigned long)amqpalloc_get_maximum_memory_used());
127123
(void)printf("Current memory usage:%lu\r\n", (unsigned long)amqpalloc_get_current_memory_used());
128-
129-
#ifdef _CRTDBG_MAP_ALLOC
130-
_CrtDumpMemoryLeaks();
131-
#endif
132124
}
133125

134126
return result;

Diff for: samples/message_sender_sample/main.c

-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
85
#include <stdio.h>
96
#include <stdbool.h>
107
#include "azure_c_shared_utility/platform.h"
@@ -162,9 +159,5 @@ int main(int argc, char** argv)
162159
result = 0;
163160
}
164161

165-
#ifdef _CRTDBG_MAP_ALLOC
166-
_CrtDumpMemoryLeaks();
167-
#endif
168-
169162
return result;
170163
}

Diff for: samples/mssbcbs_sample/main.c

-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include <stdlib.h>
5-
#ifdef _CRTDBG_MAP_ALLOC
6-
#include <crtdbg.h>
7-
#endif
85
#include <stdio.h>
96
#include <stdbool.h>
107
#include "azure_c_shared_utility/platform.h"
@@ -202,9 +199,5 @@ int main(int argc, char** argv)
202199
printf("Current memory usage:%lu\r\n", (unsigned long)amqpalloc_get_current_memory_used());
203200
}
204201

205-
#ifdef _CRTDBG_MAP_ALLOC
206-
_CrtDumpMemoryLeaks();
207-
#endif
208-
209202
return 0;
210203
}

0 commit comments

Comments
 (0)