14
14
15
15
load ("@rules_cc//cc:cc_library.bzl" , "cc_library" )
16
16
load ("@rules_python//sphinxdocs:sphinx_docs_library.bzl" , "sphinx_docs_library" )
17
+ load ("//pw_bloat:pw_size_diff.bzl" , "pw_size_diff" )
18
+ load ("//pw_bloat:pw_size_table.bzl" , "pw_size_table" )
17
19
load ("//pw_build:compatibility.bzl" , "incompatible_with_mcu" )
18
20
load ("//pw_unit_test:pw_cc_test.bzl" , "pw_cc_test" )
19
21
@@ -769,17 +771,6 @@ pw_cc_test(
769
771
],
770
772
)
771
773
772
- cc_library (
773
- name = "size_reporter" ,
774
- hdrs = ["public/pw_allocator/size_reporter.h" ],
775
- strip_include_prefix = "public" ,
776
- deps = [
777
- ":null_allocator" ,
778
- "//pw_bloat:bloat_this_binary" ,
779
- "//pw_bytes" ,
780
- ],
781
- )
782
-
783
774
# Docs
784
775
785
776
filegroup (
@@ -807,7 +798,6 @@ filegroup(
807
798
"public/pw_allocator/null_allocator.h" ,
808
799
"public/pw_allocator/pmr_allocator.h" ,
809
800
"public/pw_allocator/pool.h" ,
810
- "public/pw_allocator/size_reporter.h" ,
811
801
"public/pw_allocator/synchronized_allocator.h" ,
812
802
"public/pw_allocator/test_harness.h" ,
813
803
"public/pw_allocator/testing.h" ,
@@ -818,7 +808,224 @@ filegroup(
818
808
"public/pw_allocator/worst_fit.h" ,
819
809
"//pw_allocator/block:doxygen" ,
820
810
"//pw_allocator/bucket:doxygen" ,
811
+ "//pw_allocator/size_report:doxygen" ,
812
+ ],
813
+ )
814
+
815
+ pw_size_diff (
816
+ name = "null_allocator_size_report" ,
817
+ base = "//pw_allocator/size_report:base" ,
818
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
819
+ label = "NullAllocator" ,
820
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
821
+ tags = ["manual" ],
822
+ target = "//pw_allocator/size_report:null_allocator" ,
823
+ )
824
+
825
+ pw_size_table (
826
+ name = "allocator_api_size_report" ,
827
+ reports = [
828
+ ":null_allocator_size_report" ,
829
+ ],
830
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
831
+ tags = ["manual" ],
832
+ )
833
+
834
+ pw_size_diff (
835
+ name = "best_fit_size_report" ,
836
+ base = "//pw_allocator/size_report:base" ,
837
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
838
+ label = "BestFitAllocator" ,
839
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
840
+ tags = ["manual" ],
841
+ target = "//pw_allocator/size_report:best_fit" ,
842
+ )
843
+
844
+ pw_size_diff (
845
+ name = "bucket_allocator_size_report" ,
846
+ base = "//pw_allocator/size_report:base" ,
847
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
848
+ label = "BucketAllocator" ,
849
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
850
+ tags = ["manual" ],
851
+ target = "//pw_allocator/size_report:bucket_allocator" ,
852
+ )
853
+
854
+ pw_size_diff (
855
+ name = "first_fit_size_report" ,
856
+ base = "//pw_allocator/size_report:base" ,
857
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
858
+ label = "FirstFitAllocator" ,
859
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
860
+ tags = ["manual" ],
861
+ target = "//pw_allocator/size_report:first_fit" ,
862
+ )
863
+
864
+ pw_size_diff (
865
+ name = "tlsf_allocator_size_report" ,
866
+ base = "//pw_allocator/size_report:base" ,
867
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
868
+ label = "TlsfAllocator" ,
869
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
870
+ tags = ["manual" ],
871
+ target = "//pw_allocator/size_report:tlsf_allocator" ,
872
+ )
873
+
874
+ pw_size_diff (
875
+ name = "worst_fit_size_report" ,
876
+ base = "//pw_allocator/size_report:base" ,
877
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
878
+ label = "WorstFitAllocator" ,
879
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
880
+ tags = ["manual" ],
881
+ target = "//pw_allocator/size_report:worst_fit" ,
882
+ )
883
+
884
+ pw_size_table (
885
+ name = "block_allocators_size_report" ,
886
+ reports = [
887
+ ":best_fit_size_report" ,
888
+ ":bucket_allocator_size_report" ,
889
+ ":first_fit_size_report" ,
890
+ ":tlsf_allocator_size_report" ,
891
+ ":worst_fit_size_report" ,
892
+ ],
893
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
894
+ tags = ["manual" ],
895
+ )
896
+
897
+ pw_size_diff (
898
+ name = "buddy_allocator_size_report" ,
899
+ base = "//pw_allocator/size_report:base" ,
900
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
901
+ label = "BuddyAllocator" ,
902
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
903
+ tags = ["manual" ],
904
+ target = "//pw_allocator/size_report:buddy_allocator" ,
905
+ )
906
+
907
+ pw_size_diff (
908
+ name = "bump_allocator_size_report" ,
909
+ base = "//pw_allocator/size_report:base" ,
910
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
911
+ label = "BumpAllocator" ,
912
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
913
+ tags = ["manual" ],
914
+ target = "//pw_allocator/size_report:bump_allocator" ,
915
+ )
916
+
917
+ pw_size_diff (
918
+ name = "libc_allocator_size_report" ,
919
+ base = "//pw_allocator/size_report:base" ,
920
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
921
+ label = "LibCAllocator" ,
922
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
923
+ tags = ["manual" ],
924
+ target = "//pw_allocator/size_report:libc_allocator" ,
925
+ )
926
+
927
+ pw_size_table (
928
+ name = "concrete_allocators_size_report" ,
929
+ reports = [
930
+ ":buddy_allocator_size_report" ,
931
+ ":bump_allocator_size_report" ,
932
+ ":libc_allocator_size_report" ,
933
+ ],
934
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
935
+ tags = ["manual" ],
936
+ )
937
+
938
+ pw_size_diff (
939
+ name = "fallback_allocator_size_report" ,
940
+ base = "//pw_allocator/size_report:best_fit" ,
941
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
942
+ label = "FallbackAllocator" ,
943
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
944
+ tags = ["manual" ],
945
+ target = "//pw_allocator/size_report:fallback_allocator" ,
946
+ )
947
+
948
+ pw_size_diff (
949
+ name = "pmr_allocator_size_report" ,
950
+ base = "//pw_allocator/size_report:pmr_allocator_base" ,
951
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
952
+ label = "AsPmrAllocator" ,
953
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
954
+ tags = ["manual" ],
955
+ target = "//pw_allocator/size_report:pmr_allocator" ,
956
+ )
957
+
958
+ pw_size_diff (
959
+ name = "synchronized_allocator_size_report_isl" ,
960
+ base = "//pw_allocator/size_report:best_fit" ,
961
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
962
+ label = "SynchronizedAllocator<sync::InterruptSpinLock>" ,
963
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
964
+ tags = ["manual" ],
965
+ target = "//pw_allocator/size_report:synchronized_allocator_isl" ,
966
+ )
967
+
968
+ pw_size_diff (
969
+ name = "synchronized_allocator_size_report_mutex" ,
970
+ base = "//pw_allocator/size_report:best_fit" ,
971
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
972
+ label = "SynchronizedAllocator<sync::Mutex>" ,
973
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
974
+ tags = ["manual" ],
975
+ target = "//pw_allocator/size_report:synchronized_allocator_mutex" ,
976
+ )
977
+
978
+ pw_size_diff (
979
+ name = "tracking_allocator_size_report_all_metrics" ,
980
+ base = "//pw_allocator/size_report:best_fit" ,
981
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
982
+ label = "TrackingAllocator<AllMetrics>" ,
983
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
984
+ tags = ["manual" ],
985
+ target = "//pw_allocator/size_report:tracking_allocator_all_metrics" ,
986
+ )
987
+
988
+ pw_size_diff (
989
+ name = "tracking_allocator_size_report_no_metrics" ,
990
+ base = "//pw_allocator/size_report:best_fit" ,
991
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
992
+ label = "TrackingAllocator<NoMetrics>" ,
993
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
994
+ tags = ["manual" ],
995
+ target = "//pw_allocator/size_report:tracking_allocator_no_metrics" ,
996
+ )
997
+
998
+ pw_size_table (
999
+ name = "forwarding_allocators_size_report" ,
1000
+ reports = [
1001
+ ":fallback_allocator_size_report" ,
1002
+ ":pmr_allocator_size_report" ,
1003
+ ":synchronized_allocator_size_report_isl" ,
1004
+ ":synchronized_allocator_size_report_mutex" ,
1005
+ ":tracking_allocator_size_report_all_metrics" ,
1006
+ ":tracking_allocator_size_report_no_metrics" ,
1007
+ ],
1008
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
1009
+ tags = ["manual" ],
1010
+ )
1011
+
1012
+ pw_size_diff (
1013
+ name = "unique_ptr_size_report" ,
1014
+ base = "//pw_allocator/size_report:first_fit" ,
1015
+ bloaty_config = "//targets/rp2040:bloaty_config" ,
1016
+ label = "UniquePtr" ,
1017
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
1018
+ tags = ["manual" ],
1019
+ target = "//pw_allocator/size_report:unique_ptr" ,
1020
+ )
1021
+
1022
+ pw_size_table (
1023
+ name = "allocator_utilities_size_report" ,
1024
+ reports = [
1025
+ ":unique_ptr_size_report" ,
821
1026
],
1027
+ # TODO: https://pwbug.dev/388905812 - Make size reports always build.
1028
+ tags = ["manual" ],
822
1029
)
823
1030
824
1031
sphinx_docs_library (
@@ -830,6 +1037,7 @@ sphinx_docs_library(
830
1037
"docs.rst" ,
831
1038
"guide.rst" ,
832
1039
"//pw_allocator/examples:docs" ,
1040
+ "//pw_allocator/size_report:docs" ,
833
1041
],
834
1042
prefix = "pw_allocator/" ,
835
1043
target_compatible_with = incompatible_with_mcu (),
0 commit comments