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 @@ -119,8 +119,9 @@ cc_library(
119119
120120cc_static_library (
121121 name = "tcmalloc_standalone" ,
122- deps = [":tcmalloc" ],
123122 tags = ["manual" ],
123+ visibility = [":__subpackages__" ],
124+ deps = [":tcmalloc" ],
124125)
125126
126127cc_library (
Original file line number Diff line number Diff line change @@ -1053,3 +1053,24 @@ cc_test(
10531053 "//tcmalloc:alloc_at_least" ,
10541054 ],
10551055)
1056+
1057+ cc_import (
1058+ name = "standalone_import" ,
1059+ static_library = "//tcmalloc:tcmalloc_standalone" ,
1060+ tags = ["manual" ], # TODO: Remove once cc_static_library is always enabled
1061+ alwayslink = True ,
1062+ )
1063+
1064+ cc_test (
1065+ name = "standalone_test" ,
1066+ srcs = ["standalone_test.cc" ],
1067+ tags = [
1068+ "manual" , # TODO: Remove once cc_static_library is always enabled
1069+ "noasan" ,
1070+ "nomsan" ,
1071+ "notsan" ,
1072+ ],
1073+ deps = [
1074+ ":standalone_import" ,
1075+ ],
1076+ )
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