This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: save heap contents
- From: Andrew Lunn <andrew at lunn dot ch>
- To: R S <rusingh at ecs dot umass dot edu>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 30 Nov 2005 08:55:58 +0100
- Subject: Re: [ECOS] save heap contents
- References: <twig.1133336540.48406@ecs.umass.edu>
On Wed, Nov 30, 2005 at 07:42:20AM -0000, R S wrote:
>
> As part of my application, I need to save the contents of heap, so I can at
> any point later restore the heap to its previous state.
> Using mallinfo , I can get heap usage but inorder to copy its contents , I
> would need the exact memory address of used blocks and their corresponding sizes.
> I don't want to copy the entire heap as it might be too large. What would be
> the best way of acheiving this.?
> Any ideas in the direction will be highly appreciated.
!
What are you trying to implement? Suspend to disk? Checkpointing?
Anyway, you will need to get inside the malloc implementation and add
extra functionality.
packages/services/memalloc/common/current
The default malloc implementation is to use dlmalloc. It is also
possible to use a variable size pool, ie cyg_mempool_var_*. You might
find this easier to understand and extend with what you need.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss