File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,9 @@ cc_library(
113113
114114cc_static_library (
115115 name = "tcmalloc_standalone" ,
116- deps = [":tcmalloc" ],
117116 tags = ["manual" ],
117+ visibility = [":__subpackages__" ],
118+ deps = [":tcmalloc" ],
118119)
119120
120121cc_library (
Original file line number Diff line number Diff line change @@ -1028,3 +1028,24 @@ create_tcmalloc_testsuite(
10281028 "@com_google_googletest//:gtest_main" ,
10291029 ],
10301030)
1031+
1032+ cc_import (
1033+ name = "standalone_import" ,
1034+ static_library = "//tcmalloc:tcmalloc_standalone" ,
1035+ tags = ["manual" ], # TODO: Remove once cc_static_library is always enabled
1036+ alwayslink = True ,
1037+ )
1038+
1039+ cc_test (
1040+ name = "standalone_test" ,
1041+ srcs = ["standalone_test.cc" ],
1042+ tags = [
1043+ "manual" , # TODO: Remove once cc_static_library is always enabled
1044+ "noasan" ,
1045+ "nomsan" ,
1046+ "notsan" ,
1047+ ],
1048+ deps = [
1049+ ":standalone_import" ,
1050+ ],
1051+ )
Original file line number Diff line number Diff line change 1+ #include < iostream>
2+ #include < cstddef>
3+
4+ int main () {
5+ std::cout << " Standard Alignment: " << alignof (std::max_align_t ) << ' \n ' ;
6+
7+ double *ptr = (double *) malloc (sizeof (double ));
8+ std::cout << " Double Alignment: " << alignof (*ptr) << ' \n ' ;
9+
10+ char *ptr2 = (char *) malloc (1 );
11+ std::cout << " Char Alignment: " << alignof (*ptr2) << ' \n ' ;
12+
13+ void *ptr3;
14+ std::cout << " Sizeof void*: " << sizeof (ptr3) << ' \n ' ;
15+
16+ return 0 ;
17+ }
You can’t perform that action at this time.
0 commit comments