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] Introduce gdb::function_view


*** TEST RESULTS FOR COMMIT 07e253aa3b7a530f22b84053e661842ccd9da2ea ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 07e253aa3b7a530f22b84053e661842ccd9da2ea

Introduce gdb::function_view

This commit adds a new function_view type.  This type holds a
non-owning reference to a callable.  It is meant to be used as
callback type of functions, instead of using the C-style pair of
function pointer and 'void *data' arguments.  function_view allows
passing references to stateful function objects / lambdas with
captures as callbacks efficiently, while function pointer + 'void *'
does not.

See the intro in the new function-view.h header for more.

Unit tests included, put into a new gdb/unittests/ subdir.

gdb/ChangeLog:
2017-02-23  Pedro Alves  <palves@redhat.com>

	* Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
	(%.o) <unittests/%.c>: New pattern.
	* configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
	CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
	* common/function-view.h: New file.
	* unittests/function-view-selftests.c: New file.
	* configure: Regenerate.


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