You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
2.0 KiB

  1. From 6502e57dbebcacd9b55fc7a80655c8f31d7dae8f Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <daniel@makrotopia.org>
  3. Date: Mon, 8 Feb 2021 01:26:31 +0000
  4. Subject: [PATCH] Fix build of hugetlb tests on 32-bit platforms
  5. https://github.com/opencontainers/runtime-tools/pull/712
  6. Use explicit 64-bit types to avoid fall-back on incompatible 32-bit
  7. types on 32-bit platforms.
  8. Fixes: #711
  9. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  10. ---
  11. validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go | 2 +-
  12. .../linux_cgroups_relative_hugetlb.go | 2 +-
  13. 2 files changed, 2 insertions(+), 2 deletions(-)
  14. diff --git a/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go b/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
  15. index d71dfb9e..e1db3f1b 100644
  16. --- a/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
  17. +++ b/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
  18. @@ -24,7 +24,7 @@ func testHugetlbCgroups() error {
  19. // When setting the limit just for checking if writing works, the amount of memory
  20. // requested does not matter, as all insigned integers will be accepted.
  21. // Use 2GiB as an example
  22. - const limit = 2 * (1 << 30)
  23. + var limit uint64 = 2 * (1 << 30)
  24. for _, pageSize := range pageSizes {
  25. g, err := util.GetDefaultGenerator()
  26. diff --git a/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go b/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
  27. index b6d7ae81..583a9fa8 100644
  28. --- a/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
  29. +++ b/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
  30. @@ -21,7 +21,7 @@ func main() {
  31. // When setting the limit just for checking if writing works, the amount of memory
  32. // requested does not matter, as all insigned integers will be accepted.
  33. // Use 2GiB as an example
  34. - const limit = 2 * (1 << 30)
  35. + var limit uint64 = 2 * (1 << 30)
  36. for _, pageSize := range pageSizes {
  37. g, err := util.GetDefaultGenerator()