The Git repository of the Libabigail Project
Go to file
Dodji Seketeli 5f9a3bf4dd Fix memory leaks due to cycles in types ownership
* include/abg-fwd.h (std::tr1::weak_ptr): Inject this type in the
	abigail namespace.
	* include/abg-ir.h: Write a memory management guideline for the IR
	artifacts.
	(Type_base_wptr, function_type_wptr)
	(class_decl_wptr): New typedefs.
	(translation_unit::get_canonical_function_type): Declare new
	member function.
	(qualified_type_def::underlying_type_)
	(reference_type_def::pointed_to_type_)
	(typedef_decl::underlying_type_, function_decl::parameter::type_)
	(function_type::return_type_, method_type::class_type_)
	(non_type_tparameter::type_, type_composition::type_): Make this a
	weak pointer.
	(qualified_type_def::get_pointed_to_type)
	(reference_type_def::get_pointed_to_type)
	(array_type::get_element_type, typedef_decl::get_underlying_type)
	(var_decl::get_type, function_decl::parameter::get_type)
	(function_type::get_return_type, method_type::get_class_type)
	(non_type_tparameter::get_type)
	(type_composition::get_composed_type): Adjust to make this return
	a shared pointer initialized with the content of the weak pointer.
	(function_decl::function_decl, method_decl::method_decl): Remove
	the overload that doesn't take a type.  This is because now,
	function types need to be registered to their containing
	translation unit.
	(struct function_type::hash): Declare here.
	* src/abg-hash.cc (struct function_type::hash): Declare this in
	abg-ir.h and just define the methods here.
	* src/abg-ir.cc (fn_type_ptr_map): New typedef.
	(translation_unit::priv::canonical_types_): Remove this unused
	member.
	(translation_unit::priv::canonical_function_types_): New member.
	(translation_unit::get_canonical_function_type): Define this
	function.
	(array_type_def::priv::element_type_, var_decl::priv::type_)
	(function_decl::priv::type_): Make this a weak pointer.
	(qualified_type_def::get_underlying_type)
	(pointer_type_def::get_pointed_to_type)
	(reference_type_def::get_pointed_to_type)
	(array_type_def::get_element_type)
	(typedef_decl::get_underlying_type, var_decl::get_type)
	(function_decl::get_type): Adjust to make this return a shared
	pointer initialized with the content of the weak pointer.
	(qualified_type_def::build_name)
	(pointer_type_def::get_qualified_name)
	(reference_type_def::get_qualified_name): Adjust.
	(method_type::set_class_type): Cleanup the logic.
	(function_decl::priv::priv): Remove the overload that takes a bare
	pointer to a type.  This should not be used now that we need the
	function type to registered with the translation unit.
	(function_decl::function_decl): Remove the overload that doesn't
	take a type.  This is because now, function types need to be
	registered to their containing translation unit.
	* src/abg-dwarf-reader.cc (build_function_decl): Register the
	function type within its translation type and use its canonical
	version.  This complies with the new memory management rules.
	* src/abg-reader.cc (build_function_decl): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-10 18:08:41 +02:00
doc Fix checkout & build instructions 2014-01-14 15:39:34 +01:00
include Fix memory leaks due to cycles in types ownership 2014-09-10 18:08:41 +02:00
m4 Remove autotools artifacts from the repository 2014-06-23 14:20:46 +02:00
scripts Initial DOT work. 2013-07-23 23:13:55 +02:00
src Fix memory leaks due to cycles in types ownership 2014-09-10 18:08:41 +02:00
tests Adjust copyright year 2014-09-03 09:59:03 +02:00
tools Unite help output for tools 2014-09-09 18:14:35 +02:00
abigail.m4 For usage from within GCC set header path to $includedir/libabigail 2013-08-14 16:10:15 +02:00
AUTHORS Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
ChangeLog Remove ChangeLog 2013-07-23 23:13:54 +02:00
COMMIT-LOG-GUIDELINES Prepare for publishing 2013-07-23 23:13:55 +02:00
COMPILING White space fix in COMPILING 2013-08-22 17:40:50 +02:00
config.h.in Make zip archive support optional 2014-08-31 11:28:42 +02:00
configure.ac Display package configuration at the end of configure 2014-08-31 11:28:42 +02:00
CONTRIBUTING Fix checkout & build instructions 2014-01-14 15:39:34 +01:00
COPYING Leave license stuff for later 2013-02-28 13:20:19 +01:00
COPYING-LGPLV3 LGPLv3 License the library 2013-07-23 23:13:55 +02:00
INSTALL Update INSTALL file 2014-07-18 19:01:43 +02:00
install-sh Add missing autoconfiscation files into version control 2013-03-01 00:47:49 +01:00
libabigail.pc.in Make libxml2 a private dependency wrt pkconfig 2013-08-22 17:41:29 +02:00
ltmain.sh Add missing autoconfiscation files into version control 2013-03-01 00:47:49 +01:00
Makefile.am Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00
NEWS Initial import Abigail 2013-02-28 11:42:57 +01:00
README Prepare for publishing 2013-07-23 23:13:55 +02:00

This is the Application Binary Interface Generic Analysis and
Instrumentation Library.

It aims at constructing, manipulating, serializing and de-serializing
ABI-relevant artifacts.

The set of artifacts that we are intersted is made of quantities like
types, variable, fonctions and declarations of a given library or
program.  For a given library or program this set of quantities is
called an ABI corpus.

This library aims at (among other things) providing a way to comparing
two ABI Corpuses, provide detailed information about their
differences, and help build tools to infer interesting conclusions
about these differences.

You are welcome to contribute to this project after reading the files
CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree.

Communicating with the maintainers of this project -- including
sending patches to be include to the source code -- happens via email
at libabigail@sourceware.org.