Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: Allocate St...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 12 Topic 26079 of 26955
Post > Topic >>

Re: Allocate Static Memory?

by "Chris Thomasson" <cristom@[EMAIL PROTECTED] > May 6, 2008 at 01:48 PM

"Bryan Parkoff" <nospam@[EMAIL PROTECTED]
> wrote in message 
news:481fc7cd$0$7692$4c368faf@[EMAIL PROTECTED]
>    I want to know how much static memory is limited before execution 
> program starts.  I would write a large array.  The large array has
65,536 
> elements.  The data size is double word.  The static memory would
allocate 
> 256K.  The 256K is a fixed memory size.  After the compiler has
completed 
> compiling header and source code, the execution program might fail to
run 
> or crash.  The operating system might do not display error message
saying, 
> "Insufficient memory."
>    The dynamic memory may be the option.  The malloc() function can test

> to determine if allocated memory is available at run-time.  Then, use
I/O 
> like fopen() and fclose() functions to read data from the hard drive and

> store it into RAM.  The error message can display at run-time if
malloc() 
> tests to tell insufficient memory.
>    Please give me your advice.  How much static memory can be limited 
> before execution program starts?

This is off-topic wrt your question, but you can build an allocator on a 
plurality of threads stack spaces... I did a memory allocation scheme in
an 
environment that did not have a heap. IIRC, the OS was an older version of

Quadros on ARM9. No, heap, but each Quadros Task had stack space. So, I 
built the heap on a per-thread/task allocation algorithm. Something like:

http://groups.google.com/group/comp.arch/browse_frm/thread/6dc825ec9999d3a8

But it used bin-sema for locks instead of atomic operations. The only
atomic 
operation available on the ARM9 is a SWP instruction. I also used some
stack 
space for a globally shared heap. The entire allocation system was based
on 
task stacks.
 




 12 Posts in Topic:
Allocate Static Memory?
"Bryan Parkoff"  2008-05-05 21:50:07 
Re: Allocate Static Memory?
"Dann Corbit" &  2008-05-05 20:03:34 
Re: Allocate Static Memory?
Robert Gamble <rgamble  2008-05-05 20:13:45 
Re: Allocate Static Memory?
Peter Nilsson <airia@[  2008-05-05 21:24:24 
Re: Allocate Static Memory?
Nick Keighley <nick_ke  2008-05-06 02:00:41 
Re: Allocate Static Memory?
Noob <root@[EMAIL PROT  2008-05-07 10:28:38 
Re: Allocate Static Memory?
Ian Collins <ian-news@  2008-05-07 20:45:40 
Re: Allocate Static Memory?
Noob <root@[EMAIL PROT  2008-05-07 11:21:13 
[OT] Re: Allocate Static Memory?
Ian Collins <ian-news@  2008-05-07 21:32:05 
Re: Allocate Static Memory?
CBFalconer <cbfalconer  2008-05-07 12:18:11 
Re: Allocate Static Memory?
Charlton Wilbur <cwilb  2008-05-06 13:58:17 
Re: Allocate Static Memory?
"Chris Thomasson&quo  2008-05-06 13:48:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 2:25:15 CDT 2008.