[fpc-pascal] Using FPC MM in a C program

Vinzent Höfler JeLlyFish.software at gmx.net
Wed Dec 31 13:02:54 CET 2008


Michael Van Canneyt wrote:
> 
> On Wed, 31 Dec 2008, leledumbo wrote:
> 
>> Since it's possible to use libc's MM via cmem unit, would the opposite be
>> possible?
> 
>> >From the point of view of FPC, there should not be a big problem.
> The C library, this is another matter. I am not sure that it
> supports plugging in a memory manager.

Well, if you manage to exchange the standard memory-related subroutines 
(i.e. malloc() & Co.) from the C-library with your own subroutines, it 
shouldn't be a problem. But I don't know if that's possible if libc is 
included in the project. Technically it should if you can convince the 
linker of doing so. ;)

> There are many libraries which require you to provide memory managing routines.
> But as far as I know, this is all done using some macros.

No, last time I looked, at least in the case of the libpng this is done 
via real subroutines.


Vinzent.




More information about the fpc-pascal mailing list