From: | Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL - General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Writing SRF |
Date: | 2010-04-30 08:22:16 |
Message-ID: | o2id321138e1004300122tdb39f988tee761f9340d19b0c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Apr 29, 2010 at 8:03 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> writes:
>> Many thanks! That was one of my errors. Another one was this:
>
>> char szDataPointer[10];
>> sprintf(szDataPointer, "%p", a_pointer);
>
>> These lines caused a memory error.
>
> That looks all right in itself (unless you're on a 64-bit machine, in
> which case you need a bigger array to hold %p output). However the
> array would only live as long as the function it's in. What were you
> doing with the data afterwards, returning it maybe?
>
> regards, tom lane
>
Thanks for the tip. And about the data pointed by this address, is
copied in a safe place (I hope...) before using it to construct the
data that will be returned. Just now, it's working, but I'll be
careful.
Many thanks again!
Best regards,
Jorge
From | Date | Subject | |
---|---|---|---|
Next Message | Jorge Arevalo | 2010-04-30 08:24:50 | Re: Writing SRF |
Previous Message | A.Bhattacharya | 2010-04-30 06:58:44 | Re: FW: Java Memory Issue while Loading Postgres library |