CMem: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | 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. | |
| 2 | 2 | ||
| 3 | 3 | 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. | |
| 4 | 4 | ||
| 5 | 5 | In cases where several units like **cthreads** , **cmem** and **cwstrings** are recommended to be placed first, due to how the units work a sensible order is | |
| 6 | 6 | ||
| 7 | 7 | * cmem | |
| 8 | 8 | * cthreads | |
| 9 | 9 | * cwstrings | |
| 10 | 10 | ||
| 11 | 11 | There is a small example program [**testcmem**](<https://gitlab.com/freepascal.org/fpc/source/-/blob/release_3_2_2/tests/test/testcmem.pp>), which demonstrates the use of the cmem unit. | |
| 12 | 12 | ||
| 13 | 13 | CMem should not be used if [[heaptrc]] is used. | |
| 14 | 14 | ||
| 15 | 15 | --- | |
| 16 | - | ||
| 16 | + | *From the Free Pascal wiki, page "CMem", as the Internet Archive kept it on 2025-05-17, last changed on 2025-02-22. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
