Re: Assigning data structures to certain memory locations during porting

From: Frank Ch. Eigler (fche_at_redhat.com)
Date: 03/03/05


Date: 03 Mar 2005 17:28:00 -0500


"pieter" <pieter@gmail.com> writes:

> [...] As an example of something I'm trying to accomplish, suppose I
> have a target machine with a scratch pad, a DRAM, and a Flash
> Memory. I would like to dynamically allocate a memory space for data
> structure A in the scratch pad. [...] and then again dynamically
> allocate data structure C to Flash Memory. How do I accomplish this?
> [...]

You could use a custom dynamic memory allocation library that is aware
of the distinctions. Instead of using plain malloc/free, you would
need an API that also identifies which region you want to allocate
from. (It may also be interesting to consider where such a memory
allocation library would keep its own metadata, if it wanted avoid the
flash memory subject to wear-out or scratchpad memory subject to
exhaustion.)

- FChE



Relevant Pages

  • Re: non-paged memory inside a kernel driver
    ... With their stuff running I cannot allocate 10 MB 's on a XP system. ... disk and one flash. ... so I need 100MB of non-paged memory inside my driver. ...
    (microsoft.public.development.device.drivers)
  • Tru64 issues with Infinite limits
    ... An automated test in my nightly build was failing due to Out of Memory ... Cannot allocate block 146 ...
    (comp.unix.tru64)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: Sharing memory between kernelspace and userspace
    ... deallocate, on a totally dynamic basis, userspace ... Let userspace allocate shared memory visible to multiple ... and pass that into the kernel for it to write to. ...
    (Linux-Kernel)