Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > malloc

Reply
Thread Tools

malloc

 
 
cs
Guest
Posts: n/a
 
      11-07-2005
in chapter 8.7 of K&R2(an example of memory allocator)
if i write NALLOC==1024 (is it 1K?) in my pc (that has 40MegaBytes of
memory) and i ask memory for many arrays of more than 1K there is the
problem that Pc reads the disk (seems doesn't have memory).
instead if i write
NALLOC==1024*1024*2 (is it 2.048 MegaBytes?)
all seems right.
Where is the error?
I have an error in that malloc function?
I have an error in the function that give memory to malloc function?
I have an error in the function that call malloc function?
NALLOC is not right. What value is right for NALLOC macro value?
Thank you if you can read in the crystal ball
 
Reply With Quote
 
 
 
 
Mark McIntyre
Guest
Posts: n/a
 
      11-07-2005
On Mon, 07 Nov 2005 07:31:24 +0100, in comp.lang.c , cs <>
wrote:

>Thank you if you can read in the crystal ball


I can't. And I suspect nobody else can either. Post some actual code
instead.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
to malloc or not to malloc?? Johs32 C Programming 4 03-30-2006 10:03 AM
porting non-malloc code to malloc micromysore@gmail.com C Programming 3 02-19-2005 05:39 AM
Malloc/Free - freeing memory allocated by malloc Peter C Programming 34 10-22-2004 10:23 AM
free'ing malloc'd structure with malloc'd members John C Programming 13 08-02-2004 11:45 AM
Re: free'ing malloc'd structure with malloc'd members ravi C Programming 0 07-30-2004 12:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57