Josef Urban wrote:
On Tue, 4 May 2004, Frank Heckenbach wrote:
Josef Urban wrote:
I am looking for a clean way, how to get rid of the heap marking in gpc-20030830.
A clean way is, of course, not having to use the `System' unit at all. It's meant for the last bits of BP compatibility which can't be implemented in a cleaner way.
Which features of `System' do you (think you) need?
Probably quite a lot of the system.pas stuff: BP types like Byte and Word, constants like MaxInt, Settextbuf and ExitProc, maybe more.
Only two of them are in `System' actually.
If you use `System' only because you're used to it from BP, just get rid of it.
There is quite a lot of these BP things in our code, so removing it is some effort. Moreover, we now compile with FPC, Kylix and Delphi, and things like Settexbuf are useful there. We could do more ifdef-ing, or have our own compatibilty layer, but using system.pas seems to be the cheapest way. Maybe I will just copy the needed things to some 'gpcsystem.pas' and use it instead of system for gpc.
I don't suggest so. People often underestimate the troubles of code duplication. The initial copying is easy, of course, but keeping it up to date will cause unncessary effort in the long run.
As I said, I think we could add another conditional. Perhaps something like `__BP_NO_ALLOCMEM__' (any other suggestions)?
Frank