diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2019-02-27 08:55:56 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2019-03-08 11:09:02 +0000 |
commit | 302e30ff43401d9b1e7043a5e5c4f186ca997f66 (patch) | |
tree | 91a7e6b7790787f1d8a877c47370efa52f15575b /python_modules | |
parent | 92d5dfd4bfa7ae4857e96504a6f14c336ed85338 (diff) |
codegen: Remove support for --ptrsize
This option was used in protocol 1 to generate 64 bit pointers.
A pointer in the protocol is an offset in the current message.
This allows the possibility to have messages with pointers with more
than 4GB. This feature was removed and not used in protocol 2.
The reason this feature was correctly removed in protocol 2 is that
having 64 bit pointers in the protocol would require messages larger
than 4GB which would cause:
- huge latency as a single message would take more than 4 seconds
to be send in a 10Gb connection;
- huge memory requirements.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'python_modules')
-rw-r--r-- | python_modules/marshal.py | 2 | ||||
-rw-r--r-- | python_modules/ptypes.py | 18 |
2 files changed, 4 insertions, 16 deletions
diff --git a/python_modules/marshal.py b/python_modules/marshal.py index 4e98993..74f3a54 100644 --- a/python_modules/marshal.py +++ b/python_modules/marshal.py @@ -234,7 +234,7 @@ def write_array_marshaller(writer, member, array, container_src, scope): def write_pointer_marshaller(writer, member, src): t = member.member_type ptr_func = write_marshal_ptr_function(writer, t.target_type) - submarshaller = "spice_marshaller_get_ptr_submarshaller(m, %d)" % (1 if member.get_fixed_nw_size() == 8 else 0) + submarshaller = "spice_marshaller_get_ptr_submarshaller(m)" if member.has_attr("marshall"): rest_args = "" if t.target_type.is_array(): diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py index 7dca78d..05c594e 100644 --- a/python_modules/ptypes.py +++ b/python_modules/ptypes.py @@ -4,8 +4,6 @@ import types _types_by_name = {} _types = [] -default_pointer_size = 4 - def type_exists(name): return name in _types_by_name @@ -490,7 +488,6 @@ class PointerType(Type): Type.__init__(self) self.name = None self.target_type = target_type - self.pointer_size = default_pointer_size def __str__(self): return "%s*" % (str(self.target_type)) @@ -499,9 +496,6 @@ class PointerType(Type): self.target_type = self.target_type.resolve() return self - def set_ptr_size(self, new_size): - self.pointer_size = new_size - def is_fixed_nw_size(self): return True @@ -509,19 +503,13 @@ class PointerType(Type): return True def primitive_type(self): - if self.pointer_size == 4: - return "uint32" - else: - return "uint64" + return "uint32" def get_fixed_nw_size(self): - return self.pointer_size + return 4 def c_type(self): - if self.pointer_size == 4: - return "uint32_t" - else: - return "uint64_t" + return "uint32_t" def contains_extra_size(self): return True |