[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: openldap on AIX 4



> -----Original Message-----
> A final glitch turns out to be in the Berkeley DB library; even though we
> tell BDB to use our malloc routines, there are still several
> instances in the
> BDB library that call libc's malloc directly. So, if you didn't use cc_r to
> build BDB, you get the wrong malloc. And, since BDB is also linked by
> libtool, and libtool inserts -lc when it shouldn't, even if you build BDB
> with cc_r you'll still get the wrong malloc.

We may be using the wrong BDB interface here. We use DB_ENV->set_alloc()
which only affects some of BDB's mallocs. I believe this is only for the case
where BDB returns malloc'd DBT content to the app. There is another
interface, db_env_set_func_malloc() which replaces BDB's use of malloc
globally, i.e., for its own internal mallocs as well as for anything it hands
back to the app. Is there any down side to using ber_memalloc for everything?
Also looking over the BDB doc makes me wonder if we should be using
db_env_set_func_yield or db_env_set_func_sleep as well. Thoughts?

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support