From 8fff494926a7b59495847b10f7687a3e65eece42 Mon Sep 17 00:00:00 2001 From: Asher Mancinelli Date: Wed, 16 Oct 2019 14:10:20 -0700 Subject: [PATCH 1/4] bits -> bytes --- vm/src/obj/objint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index b0e0e4d51b..2654a75741 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -576,7 +576,7 @@ impl PyInt { #[pymethod(name = "__sizeof__")] fn sizeof(&self, _vm: &VirtualMachine) -> usize { - size_of::() + (size_of::() + (self.value.bits() + 7) & !7) / 8 } #[pymethod] From 89c76b1235d87ecb07ecea1f5838f4d6e1c303ba Mon Sep 17 00:00:00 2001 From: Asher Mancinelli Date: Wed, 16 Oct 2019 16:02:34 -0700 Subject: [PATCH 2/4] parenthesis in calculation --- vm/src/obj/objint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 2654a75741..875538cf12 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -576,7 +576,7 @@ impl PyInt { #[pymethod(name = "__sizeof__")] fn sizeof(&self, _vm: &VirtualMachine) -> usize { - (size_of::() + (self.value.bits() + 7) & !7) / 8 + (size_of::() + ((self.value.bits() + 7) & !7)) / 8 } #[pymethod] From 9459cabcc91cb22e12da3f6ddba189c744807779 Mon Sep 17 00:00:00 2001 From: Asher Mancinelli Date: Wed, 16 Oct 2019 21:16:52 -0700 Subject: [PATCH 3/4] Update vm/src/obj/objint.rs Co-Authored-By: Noah <33094578+coolreader18@users.noreply.github.com> --- vm/src/obj/objint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 875538cf12..cab079188a 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -576,7 +576,7 @@ impl PyInt { #[pymethod(name = "__sizeof__")] fn sizeof(&self, _vm: &VirtualMachine) -> usize { - (size_of::() + ((self.value.bits() + 7) & !7)) / 8 + size_of::() + ((self.value.bits() + 7) & !7) / 8) } #[pymethod] From ccd61b9d20e2dc64c58a35ccec204ee13278e437 Mon Sep 17 00:00:00 2001 From: Asher Mancinelli Date: Thu, 17 Oct 2019 08:04:42 -0700 Subject: [PATCH 4/4] Update objint.rs --- vm/src/obj/objint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index cab079188a..c1135bd94e 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -576,7 +576,7 @@ impl PyInt { #[pymethod(name = "__sizeof__")] fn sizeof(&self, _vm: &VirtualMachine) -> usize { - size_of::() + ((self.value.bits() + 7) & !7) / 8) + size_of::() + ((self.value.bits() + 7) & !7) / 8 } #[pymethod]