corrie@serss0.fiu.edu (Corrie) (07/24/90)
I am having problems allocating memory for a very simple linked list on my 4 Meg Mac+. In TC-4.0 I usually cannot even manage to get 2 nodes created. I re-loaded my THINK Lightspeed C 3.0 and was able to get a better response of about 10-15 nodes being created. This should not happen this way. TC-4.0 should be just as good as TLC-3.0 at allocating space. In addition, free() does not seem to be freeing anything. In subsiquent runs, the system runs out of memory, crashes, or (in TLC-3.0 only) displays a dialog box stating that the program has been unexpectantly exited. I even went as far as printing out the value of sizeof(Node), which to no surprise was only 6. Now, how can 6 bytes of memory times only 3 nodes cause my machine to run out of memory. The project has plenty of room to run in. I free() the list at the end. In addition, the program works fine on our VAX-8800 without modification. I have noticed, that there have been a number of questions pertaining to memory allocation using TC-4.0 this morning. Is there a problem with the way TC allocates memory, or the way the Mac handles memory. I would like to be able to write 'pure' c code, and have it work. Any suggestions/explanations ??? Aside: Has anyone heard of any C++ translator/compilers for the Mac ? Hopefully something which is 'real' C++, not those 'OOP' extentions of TC-4.0. Multiple inheritance and polymorphism is a good thing. Please send any replys to: corrie@fiu.edu (internet) or corrie@servax (bitnet) Thankyou, Corrie