Skip to content

Commit 6e4f8e4

Browse files
committed
Ensuring the static shim is linked properly
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
1 parent d90a191 commit 6e4f8e4

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

test/vcpkg-consumer/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(snmalloc-vcpkg-test CXX)
33

4+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5+
set(CMAKE_VERBOSE_MAKEFILE ON)
6+
47
enable_testing()
58

69
find_package(snmalloc CONFIG REQUIRED)

test/vcpkg-consumer/test_static_shim.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
*/
66
#include <stdlib.h>
77

8+
extern "C"
9+
{
10+
void *sn_malloc(size_t);
11+
void sn_free(void *);
12+
}
13+
814
int main()
915
{
10-
void* p = malloc(64);
16+
void* p = sn_malloc(64);
1117
if (p == nullptr)
1218
return 1;
13-
free(p);
19+
sn_free(p);
1420
return 0;
1521
}

0 commit comments

Comments
 (0)