Counting Elements?
- From: Freejack <freejack@xxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 04:28:21 -0500
I've been fiddling with Storage Pools. I can get the Allocate procedure to
allocate from an mmap() region quite easily. I can access it, play with
it, and do all the naughty stuff you're not supposed to be doing with Ada.
However I'm a little confused about a couple
things. Storage_Count depends on Storage_Offset, which depends on
Storage_Element, which depends on Storage_Unit(On GNAT Linux 32bit,
Storage_Unit is 8).
So, if I understand it correctly a 32bit Integer would be measured this
way ...
type Integer32 is array (Storage_Offset range 1..4) of
aliased Storage_Element;
I gotta make sure I understand this correctly so I can pass the right
Sizes to my Region allocators before calling mmap().
Also, while I can call munmap() directly from anywhere, my overidden
Deallocate procedure doesn't seem to be using it.(At least from what I see
using strace and my debugger. Rather than dumping the memory back to the
system at the end of a block(declare, subprogram, etc...)like I assumed
it's suppose to, it looks like it just keeps reusing the same memory over
and over again. I assumed that Deallocate is called whenever the access
type to the pool goes out of scope. Is this true? Or do I have to pass the
access pointer to a Finalize procedure? My goal is to basically dump the
entire allocated area immediately back to the Host System as soon as the
access goes out of scope.
Except for all that, everything else is working smoothly.
Currently I'm working on a downward growing Parameter stack Region(for
starters). Think Forth style stacks. Anyone have a use for something like
that?
Freejack
.
- Prev by Date: Re: Tasking and wxWidgets
- Next by Date: Re: Buffer overflow Article - CACM
- Previous by thread: Ada at FOSDEM 2006
- Next by thread: example of layered software?
- Index(es):
Relevant Pages
|