home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!caen!news
- From: Michael F. Kamprath <kamprath@caen.engin.umich.edu>
- Subject: calloc() makes my program hang
- Message-ID: <v5b-j!=@engin.umich.edu>
- Date: Thu, 13 Aug 92 21:16:13 EDT
- Organization: University of Michigan, Aerospace Engineering
- X-Useragent: Nuntius v1.1.1d5
- X-Xxdate: Thu, 13 Aug 92 21:16:16 GMT
- Nntp-Posting-Host: caenmac132.engin.umich.edu
- Lines: 39
-
- I am using multiple calls to calloc in a subroutine that is called
- multiple times. The subroutine works fine the first few times, but
- after a while, my program hangs at a call to calloc. The general
- form to my program is:
-
- foo(...)
- {
- x = (double *)calloc(N +1, sizeof(double));
- y = (double *)calloc(N + 1, sizeof(double));
- .
- .
- .
- free(y);
- free(x);
- }
-
- main()
- {
- .
- .
- foo(...);
- .
- .
- foo(...);
- .
- .
- .
- }
-
- You get the idea. Anyways, the thrird or fourth call to foo() (not the
- real subroutine) would hang at one of the calloc() calls (thank apple
- for that <control><option><command>-<escape> quitter).
-
- What would this be an indication of?
-
- Thanks for any help.
-
- Michael F. Kamprath
- kamprath@caen.engin.umich.edu
-