No heap may be used before calling InitHeap. Initialization of internal structures used by the default heap memory manager. The following list includes mandatory constants and variables that have to be declared (and usually initialized to reasonable values for the particular platform) for all platforms: The following types are assumed to be defined in platform specific part of System unit interface. Targets which need to limit the set of supported features need to include - UnicodeString type The list of features enabled for all targets by default is specified at the beginning of systemh.inc. In order to provide this level of flexibility without sacrificing the aim of sharing as much code as possible, there are conditional defines set for individual targets specifying features available for that targets. You might wonder how the compiler knows where to find the different include files - this is handled in the Makefile (generated from Makefile.fpc rules using our fpcmake tool - see /utils/fpcm/).Ĭertain targets are not capable to provide certain functionality due to their limited nature (typically certain embedded systems, etc.). As an example, target specific implementation of file handling needs to be provided in file sysfile.inc. various BSD based targets have shared parts in /rtl/bsd/, all *NIX targets have shared parts in /rtl/unix/ and various MS Windows targets may use shared parts in /rtl/win/.įinally, the complexity of the System unit led to the situation that the common implementation part expects certain parts of the target-specific implementation in specifically named include files which need to be made available in the subdirectory for the particular target, or possibly in a subdirectory shared among several targets as mentioned above. Moreover, there may be parts which are shared by several targets having certain similar aspects - e.g. In addition to parts which are shared among all targets, there are also parts which may be shared for all targets on a particular CPU / platform stored in a subdirectory named after the CPU / platform (e.g. In the particular case of unit System (and partly also some other more complex units), there are quite a few more include files involved, though. The parts shared for all targets (like the two include files mentioned above) are stored in /rtl/inc. Similarly to other parts of FPC RTL (and also units included in packages), the general pattern is that units requiring at least some platform / target specific parts have the main source file (system.pas in case of unit System) in the specific subdirectory specific for the particular target, but this file refers an include file containing the common interface (systemh.inc) and another include file containing implementation of platform independent stuff (system.inc) - obviously, we try to share as much as possible rather than duplicating the same code on several places.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |