comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing Generics with C Pointers
@ 2003-03-17 13:56 Brian Palmer
  2003-03-17 20:09 ` Robert A Duff
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Palmer @ 2003-03-17 13:56 UTC (permalink / raw)


I've got a problem where I get in a pointer to a block of memory that was 
allocated in C++.  In addition to the pointer, I get the number of bytes 
that were allocated.  The Ada type that the memory comes in as is a pointer 
to an unconstrained byte array.  Whenever I try to dereference the pointer, 
I get a CONSTRAINT ERROR.  I think the problem is due to the compiler 
trying to access a storage location within the type that tells how many 
bytes are there.  I feel like I could constrain the base type and get 
around the problem, however, this mechanism is used for several different 
size blocks of memory, several hundred times per second, and I don't want 
to have to allocate more memory than necessary.  Any ideas how to access 
unconstrained memory without the compiler looking for that built in 
element?

Any help would be appreciated.

-Brian Palmer



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-17 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-17 13:56 Interfacing Generics with C Pointers Brian Palmer
2003-03-17 20:09 ` Robert A Duff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox