[fpc-other] PROLOG written in Pascal

Mark Morgan Lloyd markMLl.fpc-other at telemetry.co.uk
Sun Sep 21 18:34:46 CEST 2014


Bernd Oppolzer wrote:

> I have a library done for other projects which supports
> memory management routines, where the memory allocations
> may belong to different classes of memory, and then you are able
> to free all memory belonging to one class with one single call.
> 
> That is, there are calls similar to C-malloc, calloc, realloc and free,
> but a class identifier is added to every call. And there is one additional
> freeall() call to free the entire memory class.
> 
> The routines outperform the normal ANSI C functions on certain systems.
> although they put a layer of management on top of the normal ANSI C 
> functions
> (because many calls to allocate little areas of memory result to one 
> call of
> the ANSI C function to allocate a large area and some internal 
> management ...
> I used this approach to make my XML parser faster than others ... and the
> freeall() call at the end of the parsing makes XML parsing safe; the 
> working
> storage of the parser is freed, but the resulting DOM tree, for example 
> - if you use DOM - ,
> is not ... it resides in a different memory class).
> 
> This is written in C, but it should of course be callable from FP as well;
> there are no architecture dependencies. It runs on Windows, OS/2, Linux
> and even on z/Arch mainframes (so does the XML parser).
> 
> Please contact me offline, if you are interested. Maybe you could use it
> with your PROLOG project, if you are able to "classify" the memory 
> allocations
> in the PROLOG code.

Interesting, but this isn't something that I'll be immediately looking 
at thanks. In any case, I'd probably be focussing on the general case 
(see the examples I referenced earlier), and I think that the memory 
management for rules based on objects will be completely different from 
the case where rules are based on Lisp-type strings (i.e. each string is 
stored as a linked list of cells).

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


More information about the fpc-other mailing list