Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using libc in a C++ program

0 views
Skip to first unread message

begin.mi...@gmail.com

unread,
Jul 4, 2008, 2:46:59 AM7/4/08
to
Hello,
I am working with an application that is mainly written in C++
(thunderbird to be specific). Anyway, I added a couple of functions,
written in C, and having a few libc calls (malloc, sprintf etc). The
problem I am having is that the first time those libc functions are
invoked, loading(or executing?) them is taking very long. (running it
under GDB and stepping through the code, on the libc function calls it
takes about 5-10 minutes to return on a dual core machine). However,
once a libc function is invoked and returned, it returns fast as
expected in subsquent invocations.

I tried to statically link libc, but still have same issues. Have any
ideas?
Thanks a lot
--
comp.lang.c.moderated - moderation address: cl...@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.

Jack Klein

unread,
Jul 8, 2008, 10:18:41 PM7/8/08
to
On Fri, 4 Jul 2008 01:46:59 -0500 (CDT), begin.mi...@gmail.com
wrote in comp.lang.c.moderated:

> Hello,
> I am working with an application that is mainly written in C++
> (thunderbird to be specific). Anyway, I added a couple of functions,
> written in C, and having a few libc calls (malloc, sprintf etc). The
> problem I am having is that the first time those libc functions are
> invoked, loading(or executing?) them is taking very long. (running it
> under GDB and stepping through the code, on the libc function calls it
> takes about 5-10 minutes to return on a dual core machine). However,
> once a libc function is invoked and returned, it returns fast as
> expected in subsquent invocations.
>
> I tried to statically link libc, but still have same issues. Have any
> ideas?
> Thanks a lot

Here's my idea.

Ask in a gcc support group, or mailing list. There is nothing in the
C language that specifies the workings of GDB, or for that matter
about using C code in C++ programs.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

0 new messages