Difference between revisions of "CMem"
From Lazarus wiki
Jump to navigationJump to search (mention heaptrc, remove categories already included via Template: CMem, remove “back to <some arbitrary page>” link as there are multiple pages linking here) |
|||
Line 1: | Line 1: | ||
{{CMem}} | {{CMem}} | ||
− | + | ||
− | |||
If you include the '''cmem''' unit in your uses clause of your program, it will replace the native Free Pascal memory manager with the C library memory manager. All memory management is then done by the C memory manager. | If you include the '''cmem''' unit in your uses clause of your program, it will replace the native Free Pascal memory manager with the C library memory manager. All memory management is then done by the C memory manager. | ||
− | The unit should be the first unit in the uses clause, otherwise memory can already be allocated by initialization routines in units that are initialized before the C memory manager is installed. | + | The unit should be the first unit in the uses clause, otherwise memory can already be allocated by initialization routines in units that are initialized before the C memory manager is installed. |
There is a small example program '''testcmem''', which demonstrates the use of the cmem unit. | There is a small example program '''testcmem''', which demonstrates the use of the cmem unit. | ||
− | + | CMem should not be used if [[heaptrc]] is used. | |
− | |||
− | |||
− |
Revision as of 18:43, 18 June 2020
│
Deutsch (de) │
English (en) │
If you include the cmem unit in your uses clause of your program, it will replace the native Free Pascal memory manager with the C library memory manager. All memory management is then done by the C memory manager.
The unit should be the first unit in the uses clause, otherwise memory can already be allocated by initialization routines in units that are initialized before the C memory manager is installed.
There is a small example program testcmem, which demonstrates the use of the cmem unit.
CMem should not be used if heaptrc is used.