buffer8848 / gperftools

Automatically exported from code.google.com/p/gperftools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need version macros in dev headers and version API

GoogleCodeExporter opened this issue · comments

Application that depends on tcmalloc would like to find out which version
the tcmalloc is, so it can warn about old versions at build/configure phase
and whether there is a mismatch between headers and libraries.

Something like TC_VERSION macros and tc_version() a la Berkeley DB headers
would be great.

Original issue reported on code.google.com by vic...@gmail.com on 5 Sep 2009 at 12:46

Good idea!  I'll look into getting tc_version (but probably not TC_VERSION, 
since I'd
rather avoid macros until there's an identified need for it) into the next 
release.

Original comment by csilv...@gmail.com on 10 Sep 2009 at 8:45

  • Changed state: Started
  • Added labels: Priority-Medium, Type-Enhancement
Both (macros and API) are needed for checking header/library mismatch, 
especially for
shared libraries. Such mismatch (header has different struct size/members or 
function
arguments than those in the library) can lead to crashes that are hard to track 
down,
especially for C linkage, where only function names are used at link time.

Original comment by vic...@gmail.com on 10 Sep 2009 at 9:24

OK, I can look into adding a macro.  I couldn't find any documentation of 
DB_VERSION
from libdb; can you point me to what you were thinking the macro should look 
like?

Original comment by csilv...@gmail.com on 10 Sep 2009 at 10:02

Excerpts from /usr/include/db.h:

/*
 * Berkeley DB version information.
 */
#define DB_VERSION_MAJOR        4
#define DB_VERSION_MINOR        7
#define DB_VERSION_PATCH        25
#define DB_VERSION_STRING       "Berkeley DB 4.7.25: (May 15, 2008)"

char *db_version __P((int *major, int *minor, int *patch));

Original comment by vic...@gmail.com on 10 Sep 2009 at 10:34

I've added a similar set of macros and functions to perftools 1.4, just 
released.

Original comment by csilv...@gmail.com on 11 Sep 2009 at 7:00

  • Changed state: Fixed