[fpc-pascal] fp libraries do not like cmem ?
Ewald
ewald at yellowcouch.org
Fri Feb 14 20:12:25 CET 2014
On 14 Feb 2014, at 20:06, Fred van Stappen wrote:
> Hello.
>
> It seams to me that i monopolize the forum here.
> Please advice if it borrow you, i will stop directly... ;-)
>
> I still fight with cmem and trust me, it is a hard battle.
What I have been wondering for some time now (perhaps you wrote it in a mail and I missed it): do you use the same memory manager in the library and in your test program?
Also, beware when returning pointers. Consider this snippet:
Procedure ReturnTheAnwer: PInteger;
Var a: Integer;
Begin
a:= 42;
Result:= @a;
End;
One might think at first glance that `ReturnTheAnswer^` is 42, but this is incorrect in some cases. The example here might be extremely over-simplified, but replace `a: Integer` with `mystring: String` and we're roughly at your example.
--
Ewald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140214/93d67c3b/attachment.html>
More information about the fpc-pascal
mailing list