On 23 September 2010 11:50, Michael Van Canneyt wrote:
>
> [ Snip: I'll see about what I can add to make it more clear ]
Thanks. I just want the docs to be all that they can be. :-)
> Take care that in this case you should not use a dynamic array to refer to
> the memory allocated by the C API:
On Thu, 23 Sep 2010, Graeme Geldenhuys wrote:
On 23 September 2010 09:46, Michael Van Canneyt wrote:
my FPC Language Reference docs with what you mentioned, or see if
Michael van Canneyt could add that info into the official docs so
others can benefit too.
What do you want added ? I haven't
On 23 September 2010 09:50, Honza wrote:
>
> AFAIK yes as long as you don't break (it's possible using some wild
> casting) the ref counting mechanism and handle the zero length case.
In my case [working with the Xlib library], I will never have the case
of a zero length array. So that I don't nee
On 23 September 2010 09:46, Michael Van Canneyt wrote:
>> my FPC Language Reference docs with what you mentioned, or see if
>> Michael van Canneyt could add that info into the official docs so
>> others can benefit too.
>
> What do you want added ? I haven't seen anything which isn't already
> ment
2010/9/23 Graeme Geldenhuys :
> Out of interest. Do you know if dynamic array elements are in sequence
> (storage area in memory) too - like static arrays? So could I do the
> same as above, but instead of using a static array, use a dynamic
> array, and pass the address of the first element to the
On Thu, 23 Sep 2010, Graeme Geldenhuys wrote:
Hi Michael,
On 23 September 2010 00:49, Michael Müller wrote:
So when the array memory is allocated by the calling function and freed
by another function and you only what to be able to access the elements
using the array braces you should use t
Hi Michael,
On 23 September 2010 00:49, Michael Müller wrote:
>
> So when the array memory is allocated by the calling function and freed
> by another function and you only what to be able to access the elements
> using the array braces you should use the static array approach. But I
> would defin
On Thu, 23 Sep 2010 00:49:29 +0200
Michael Müller wrote:
> Another problem is often to free memory in Pascal that was allocated by C.
Having done some interaction with C libs IMHO the best option is not to free
the memory in pascal at all but doing it with the provided C functions (if the
lib d
Hi Graeme!
Am 22.09.2010 um 11:25 schrieb Graeme Geldenhuys:
> Hi,
>
> I'm have some tough times with arrays (I use them very little). With
> trial and error I found that to use a pointer to an array of int32
> values returned by a C API (Xlib to be exact), I have to define it as
> follows in Ob
2010/9/22 Graeme Geldenhuys :
> type
> TAtomArray = array[0..0] of TAtom;
> PAtomArray = ^TAtomArray;
>
> Now if I change TAtomArray to the follow, then my code doesn't work. :-)
>
> TAtomArray = array of TAtom; // a dynamic array
>
> So what exactly is the difference between these two?
>
>
Hi,
I'm have some tough times with arrays (I use them very little). With
trial and error I found that to use a pointer to an array of int32
values returned by a C API (Xlib to be exact), I have to define it as
follows in Object Pascal.
type
TAtomArray = array[0..0] of TAtom;
PAtomArray = ^TAt
11 matches
Mail list logo