Re-arrange struct layouts to reduce in-memory size of public types

Full measurements before [1] and after [2]

Savings:
 - skcms_ICCProfile: 1016 -> 976 bytes (-40 bytes; 3.7%)
 - skcms_A2B: 416 -> 400 bytes (-16 bytes; 3.8%)
 - skcms_B2A: 408 bytes -> 400 bytes (-8 bytes; 1.9%)

I found these by inspecting the output of
bazel build //:skcms_public --copt "-Xclang -fdump-record-layouts -Wpadded -Wno-error"

There were a few other warnings but re-arranging the structs wouldn't
have done anything due to 8 byte alignment.

This adds one test that was helpful when debugging an issue I
had while creating this CL.

[1] http://gpaste/5485377728282624
[2] http://gpaste/6273912634867712

Change-Id: I0ed18f85640537844f0953bda9b6848399968479
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/924237
Commit-Queue: Kaylee Lubick <kjlubick@google.com>
Reviewed-by: Daniel Dilan <danieldilan@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
3 files changed
tree: 6e57e2e83315e351612def5aa701dc09efbb7684
  1. bazel/
  2. fuzz/
  3. infra/
  4. ninja/
  5. profiles/
  6. src/
  7. toolchain/
  8. .bazelrc
  9. .bazelversion
  10. .gitignore
  11. BAZEL.md
  12. bench.c
  13. BUILD.bazel
  14. build.ninja
  15. codereview.settings
  16. iccdump.c
  17. LICENSE
  18. msvs.ninja
  19. OWNERS
  20. README.chromium
  21. README.md
  22. skcms.cc
  23. skcms.gni
  24. skcms.h
  25. test_only.c
  26. test_only.h
  27. tests.c
  28. whitespace.txt
  29. WORKSPACE.bazel
README.md

To build with ninja, simply run ninja from the root directory. This will produce a library in /out.

There are also Bazel rules, outlined in BAZEL.md