This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Use std::unique_ptr in reg_buffer


*** TEST RESULTS FOR COMMIT 835dcf92618e294d3c6c2bedd94af712809c96a3 ***

Author: Simon Marchi <simon.marchi@ericsson.com>
Branch: master
Commit: 835dcf92618e294d3c6c2bedd94af712809c96a3

Use std::unique_ptr in reg_buffer

Using std::unique_ptr allows to remove the manual xfree in the
destructor.

If I understand correctly, using the () after the new operator will make
sure the allocated objects will be value initialized, which for scalars
means they are zero-initialized.  So it should have the same behavior as
XCNEWVEC.

gdb/ChangeLog:

	* regcache.h (reg_buffer) <~reg_buffer>: Use default destructor.
	<m_registers, m_register_status>: Change type to
	std::unique_ptr.
	* regcache.c (reg_buffer::reg_buffer): Use new instead of
	XCNEWVEC.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]