Re: [patch][python] Implement Python lazy strings (PR 10705)

Tom Tromey
2010-01-12T17:02:49Z

>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Phil> + output = convert_value_from_python (string);

Tom> Why do we need to do this?
Tom> Can't we just get the address directly?

Phil> As a lazy string is a pointer, the code needs to actually find the
Phil> type associated with the characters in the string. So later in the
Phil> code:
Phil> if (TYPE_CODE (value_type (output)) == TYPE_CODE_PTR)
Phil> output = value_ind (output);

Yes, but calling convert_value_from_python means calling a method on the
Lazy_string object to get a Value, then unpacking that -- but the actual
pointer value is directly available in the object.

Tom