comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Palmer <bpalmer@elmco.com>
Subject: Interfacing Generics with C Pointers
Date: Mon, 17 Mar 2003 13:56:29 +0000
Date: 2003-03-17T13:56:29+00:00	[thread overview]
Message-ID: <v7c9f6sa793403@corp.supernews.com> (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



             reply	other threads:[~2003-03-17 13:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 13:56 Brian Palmer [this message]
2003-03-17 20:09 ` Interfacing Generics with C Pointers Robert A Duff
replies disabled

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