[RFA] "lazily" allocate the raw content of lazy values

Jerome Guitton guitton@adacore.com
Thu Nov 27 02:18:00 GMT 2008


Joel Brobecker (brobecker@adacore.com):

> > 2008-11-25  Jerome Guitton  <guitton@adacore.com>
> > 
> > 	* value.h (allocate_value_lazy): New function declaration.
> > 	(value_free): Remove macro, make it a function.
> > 	* value.c (value): Move actual content outside of the memory space
> >         of the struct; add a pointer to this actual content.
> > 	(allocate_value_lazy, allocate_value_contents): New function.
> > 	(allocate_value): Reimplement using these two new functions.
> > 	(value_contents_raw, value_contents_all_raw): If no memory
> > 	has been allocated yet for the actual content, allocate it.
> > 	(value_contents_all): Resync with struct value's changes.
> > 	(value_free): New function.
> > 	(value_copy, value_primitive_field): Use new function
> > 	allocate_value_lazy to allocate lazy values.
> > 	(value_change_enclosing_type): Resync with struct value's changes.
> > 	As the value is not reallocated, remove the special handling for
> > 	the value chain (now obsolete).
> > 	* valops.c (value_at_lazy): Use new function allocate_value_lazy.
> > 	(value_fetch_lazy): Allocate value content. Use allocate_value_lazy
> > 	to allocate lazy values.
> > 	(value_slice): Use allocate_value_lazy to allocate lazy values.
> 
> Pre-approved after the following minor nits are fixed.

Fixed in the patch in attachment. OK to apply?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lazy_values.diff
Type: text/x-diff
Size: 10914 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20081127/dac2d372/attachment.bin>


More information about the Gdb-patches mailing list