Description: RTL heapmanager related
This file as text.
(active) Revisions in this set:
56f0a71466be36f158e239238517287a47e59335,7b3e027dc8fdf8f4b188c8df7af23ac9b2c1d4e4,8015bfb5a08f3dad271472b11da7cbf3b2f87515
f0213a2c46a9fd1ea047da6c8f54b78823ef9c71,693e72ade31fda191fac405b81dd5f28afc6e47a,ee22dbe5898ef29cfe1c773e6f751ede99cf544f
c0372f80e00913d849ff6dbcf3387e664c74a6ec,99680eb88c425cd71edf808d6084fa51a636696c,0dabe496019e970e657cc95f3c34d45ddc3fe4ef
8b24033e93b3cc381cd27a137149ca5cd870ebba,ac8552afc2697be02cc955d42bf0f62ee2ea3a3a,6698f6c56b76c60476a15f20a4135dc8ca030acd
6edbc9ed7e3453a0ea19d2f64b01d6049f9aeeca,9d41a435c2c9524623f4c6002cfcd33f3c0822d4,d52aaf63eba440f2d8c8c13ce38c76e88a7f4e7e
caa2735203b91db513fe8af1e835aa711c0ccf77,86c036d9ed8a63040dbe4adf22c96668d94fc7cb,c298c0e0dadb96a99040b766091784831dd9d6f1
f12fcc9e065a6550617261dea1d9073cd4cea94b,b30a1bf447b75c7260eaafb1acaa7d008bdf48ea,ae346a87a128eb15db921cad916258839a1fe5ce
46de243fe607d4117a40994bb7b135013708f617,5418ccf31ebfe3857cfa784367f22eab253e1f22,8c8f8088ebaf68c83500668e97b9c16c41f7d92e
d3bc8745006e9b5278c325572b020956a844e219,ec8d82332ac7d9be03ff8ca0829b567140a7bade,d2d3fe6bc3f7499ef111e689fb848dab2a18fdae
ab3aae149bf7c9782b851201b66c57ddae42ea26,fb5b891c45a0774f0429eb672402bf760a61fb9a,591ad88ec0e0b97eef7685513770276cdcae7bd9
c4c3c2a7aa39e10488c5683a24f692340a2f90a5,442e9d2573af26be3f770a38157ad14031a5e62b,d85d6b4bac75a65672dc646dbc80eb14b6086377
d009941744f5566c8e36e931c43093b5783c3161,0b65c173b8a6a893ea0738e78bb13411cbcc9252,be4e5f240c9cef72e0867de9cf5aada8a564d459
4e1f854d49059d8eabd0e39d526a58dcdaec81b4,6489b6fc3662533e8785e06a3c1b8e22c6f46249,cb6fe28898d951afa14e282856dc4dc13366e328
41ae52dde1f6a3b213c49316921a2d8824d46077,7d1999eedb23e0560ae2e2840ae52decbf733e73,c95dfe24e7203ebc73429d5bbb839d6aba1c8b67
7681c192dbb6d74b6944061863445a55825506a1,6be3a42a2f18a349402d18241c83d68c492c7bd5,feb7d54553838a48873fc2a198e822740f2ed733
322301ef0b108e3d567b014af89125157c7c0a52,47b45068026c90557ae7a99cf0ba1016782cd924,94e399faf701699bf5b211ceb581ec4461377936
c08d73054a8e99c38a588df27c30115f298fcec8,ba7a76bf37e402167f65e8a7a4ac97a0bf595da3,f6726b6a874fd6280cf343482c50168247088400
7703ff9b34ee48665b37f418b699a3229c0bcaf5,1d22802ba97ac135714c8f6944c745517c3ad3c2,736fc12e55ab4872f92d85a6d45f038bd658f94f
5952c5452b2a8db9b25083b7d9a88e6a6148d56a,06aff099c163330f64f6a871ebe4ede1fabe7286,c8bf474d6d0fd0aab4399033d42c643c9264a3d4
1f3cdf10b70bb83e82dc8ae3f3061a46814577a7,2de241b9ac50be94703ea3d7956cf27e3244a685,dfbd4eac2a81a88c0e11367d0159781c2e254821
1ae6ea8f88bb85e469d4f3bc2672859c3147c94c,198abf11102dffe016017ab966dd97741ce0a93f,571088ff80cc883c5a26840a9fc41445b25af0ae
a8baa49c8612634d317d916904feaa2acba67bcb,37a74744713d98643bddae01e040d19f2e547eba,463a14e2951704b0937ddbb7d601716b9526e4ea
1ca244023f1782753c3369f5162702b87a906300,1527c578bfe0060db2a9b5d06bc55f10cad2acb4,7e0e284fce59b7e1a0f7638db205bcc9bbb576cf
02752fdd36d556ebab970c2d8eba0ce689fcabb4,20fb141ca24489f8c5f026c5ca360de5e8a7a2bc,0a45266aeca2b784c6fd65360ea318b489a9a504
85345c54d878838e8b1f034c2d55d6a34104b443,cb4bcaa068c86564249be6f58c28458c8fa839d0,bc59422f00c3ce3b451f543013a4a50139e80a6b
6473bc1e82d28374fdcd4d1c2eb3ac8c1a3d6d7a,df8c00e2bb03a9a4b406d1e90333a87869182187,562048c965f06a75caf878087aae44a10be56a55
5c5ace6b13b7adcc050237bd80b34568d03bec89,2c542734537fb87fb264ed30fa7becd294e1dc51,7435893d392e199f9379a218582ab6a650de2917
7452fb5477cfccbea4bac1ae10d3647df461504b,5e0cbc5b22c666cd7536db5c81479a4fe10f9964,9f4483823a03b7116660be0d07a5068f2d5233d6
1ab295ac6b3f612f318457c48f345b471bca94e7,bbf0df48ad89c8ecb9f5e023ac737eb6aecc27f2,64eb8083acd7f61127c9cd748f274e04a4ea16aa
db09ff937030ed73675d17c403997da9942f5f5d,4e69e46b8e551b6a6ce612b9488d69e6e012e334,49805e03616c0722aefcb1c4b1819fbb3482c531
4f2bf506e508961866180ea6dcb716a78d57e8d5,32c1d7f9bd72bfd4305e5b566708021c7efb7f80,d91a4ef56f98b1d4695cf7cd8312b9458ac425c6
2aa8fe76d96326e9adaa2e463831260e41d7bab2,9c2da4ad14ef9fb3868d26caaf42406f399fc887,354b335b0674006c5f951a20b8764c5b06151e95
78f7d0bd1e984457dc332ccc982561502c8531f4,06b17e637162b071d56996459d2724b7372a7a0b,928312d331b06658316fb1d7a1adb55ded530e60
b8f789143a02159cae1ba9ae309e42408b317562,6a7d42bb22ff18fd0617108517ba9ece4b7a3e14,50732a780ec8665f1b8fe5bbb84de2db0b649b44
08c1e50ebc0c0b049db198fe71d7d2419ec4922b,2b44cafdf397117578fc974e4a842a997c09fca2,daa27044ec474e9b6c547cae667653fb8e574cc7
28f6bb4ef1cccbe6b6cf719505ad44b23db64633,0666ce8bda13741d33ef9a22b878ae0bab86d410,9a39e9ef8a001914b2c51dd587139227247089cb
88df11c0194864fd6ac6540244e483ff2c5d83e3,7b4387b267ef6a8dae4f7f637e96c9ebdee096f1,23f09802686b0fa4d5b204419899576f14059b1e
0ee82363fc2b5add7564b8be81df2a4b4709fe93,887dc52ef4ed6fbd3f913c8a7dab3d54549e2dc0
Clicking a revision will expand files
heaptrc: empty the array for the call trace, otherwise the trace dump code will just dump the rest of the array as well, on systems where the heap is not initialized to zero, or if the memory area has been re-used
Move update of fields counting allocated memory to after SysGetMem call
Fix arm specific failure in tw12048
+ make use of the mremap syscall of linux to re-allocate large memory blocks faster
* Darwin now uses Mach VM calls for memory allocation instead of mmap/munmap
+ added sysrealloc support for Darwin (Darwin does not have mremap)
Handle change of memory base address after call to SysTryResizeMem
* with section threadvars, heap relocation is not needed
* patch by Anton Kavalenka: heaptrc: Improve tracing by printing actual
module name (ether EXE or DLL), resolves
0036130
* fix building on non-unix/windows targets
* last fix was most likely not complete
+ add initial RTL for MSX DOS. Simple programs are already working, but there are apparantly some code generation problems that lead to I/O as well as parameters not working correctly
* patch by Christo Crause: FreeRTOS: heap manager doesn't free small blocks, resolves
0037195
* tinyheap: Early check for very big requested mem sizes in order to prevent overflows and properly report the out of memory error.
* tinyheap: Disable inline when FPC_TINYHEAP_HUGE is defined to prevent code bloat.
msxdos target uses same __fpc_envp symbol as msdos
osheap: new very small heap manager which only acts as a thin layer above an OS provided heap API. mainly aimed for small and embedded systems
Explicitly disable range and overflow checking to avoid troubles with pointer arithmetics
rtl/osheap: fixed a dumb reversed condition in osheap/SysAllocMem()
* rtl/atari: do not default to tinyheap for now. the compiler itself doesn't work with tinyheap for some reason
* rtl/atari: naming: gemdos_free is actually gemdos_mfree. no functional change.
* ensure that the heaptrc unit can be used on Linux and BSD without linking against the C library
* fix bootstrap with 3.2.2, whi
* fix bootstrapping *BSD with 3.2.2, which isn't flagged as supporting weakexternal on those targets
* Seems not all was committed
* googleapiconv fixes and cleanup (ref
gitlab 0040094)
- Add updated URL for google api discovery
- Fix incorrect usage / help messages and put options in alpha order
- Replace "with .. do" statement with a local variable for clarity
- Add missing DiscoveryJSONToPas.Execute so output files are not empty
- Add FreeAndNil(Application) to clear a memory leak
(it now has a clean Heaptrc)
- Minor fix to .lpi file which had incorrect dependency.
Add heaptrc and fix several namespaced unit names
human68k: add an RTL skeleton, almost nothing is implemented yet
human68k: RTL works enough now to run a hello, world!
human68k: handle the OS malloc returning errors properly
human68k: setup the stack, then use setblock to limit the memory usage to the amount we're really using. this frees up RAM, and allows the heap allocator to work.
human68k: disable tinyheap, as there's some memory trashing going on with it, and use the regular one for now
m68k-sinclairql: make heaptrc compile for the QL
* patch by Rika + test: Don’t explicitly change GetMem(0) to GetMem(1), it works anyway, resolves
gitlab 0040456
Shorten win/systhrd.inc; fix SetThreadStackGuarantee signature.
Add support for DISABLE_SYSTEMINLINE inside heaptrc unit
Import Heap* functions on WinCE.
* WASI: preserve the initial value of the stack pointer on startup, so that we
can later use the area after that, until the end of memory as an initial heap
+ WASI: use an initial heap area, that exists between the end of the stack area,
and before the end of initially allocated memory. This recovers some memory
that was previously wasted and delays the first call to memory.grow
* WebAssembly threads: protect SysOSAlloc against race conditions via a critical section
* WebAssembly: optimized SysOSAlloc to use memory area left at the end of the
page (64kb). This reduces memory use, when SysOSAlloc is called with sizes,
smaller than 64kb.
Fix compilation of heaptrc unit using fixes branch bsd compiler
* PS1: initialize the heap with the proper addresses - between bss_end and StackBottom
* PS1: call InitHeap to finish the Pascal part of the heap initialization
* PS1: clamp the stack size, so it doesn't exceed the maximum memory available (minus 1k for heap)
Return MemSize from FreeMem.
Allow MemSize(nil) to match FreeMem(nil).
* moved the common WASI RTL source files and includes to a 'wasicommon' dir
+ initial wasip2 rtl, most things are not implemented
* Allow wasm guest & host to be notified of wasm memory growth
Allow freeing EHeapException and its descendants.
* Move heap to oldheap, prepare for MR !694
* Switch to new heap by RuneWalsh (MR !694)
* Inline some heap manager calls
* fix line history part 1
+ fix line history part 2
* fix line history part 3
* restore forgotten oldheap.inc
Pass huge chunks directly to SysOSAlloc/Realloc/Free.
Use red-black trees for variable freelists.
Call custom MemoryManager.DoneThread before FinalizeHeap.
RbTree.ChangeInPlace for cheaper reinsertions.
Make HeapInc.gs.hugeUsed atomic.
Always return allocated size in TraceFreeMemSize
Allocate fixed arenas within variable OS chunks.
Orphaned chunks can’t have empty arenas.
Instantly free OS chunks of dead threads.
Remove HeapInc.FirstFlag.
Change RbTree to a FastMM-like two-level bitfield.
Inline AllocFixed & FreeFixed (and make friendlier to inlining).
Allow shrinking small chunks.
Scan orphaned freelists for free space as a last chance before allocating new OS chunk.
Remove FPC_IN_HEAPMGR, FPC_NO_DEFAULT_MEMORYMANAGER, and unnecessary uses of FPC_NO_DEFAULT_HEAP.
Reduce VarHeader size to 8 bytes.
Round medium sizes up to the bin size.
Allow semi-invisible medium chunks smaller than the minimim size.
Correct position of Clock and Heap view after screen resize.
Reallocate memory AGGRESSIVELY, incline ReallocMem to defragment.
Finish heaptrc to-free queue before reporting leaks.
Outline heaptrc output file selection.
Remove getmem8_size and freemem8_size; make EntryMemUsed thread-local.
Track TFPCHeapStatus.MaxHeapUsed less thoroughly.
Inline two variants of VarSizeToBinIndex and fix an irreproducible bug in unsynchronized gs.varFree.Find.
Update maxUsed at the correct moment.
Allocate fixed arenas loosely.
Fix cross-thread ReallocMem in heaptrc.
Free empty arenas as a second-to-last chance before allocating a new OS chunk.
Simplify VarSizeToBinIndex.
Initialize the heap lock in DLL_PROCESS_ATTACH and finalize in DLL_PROCESS_DETACH.
Explicitly load C library on Linux as already done in dl unit, to avoid wrong sartup code
Simplify BinIndexToVarSize.
rtl/heap: fix builds of systems that define HAS_MEMORYMANAGER after 78f7d0bd
Fix leaks on DLL unloading.
+ add more verbose and robust detection of error scenarios to the heap manager
rtl/heap: while dealing with orphans, do not call FlushToFree if toFree is nil. this fixes a crash while exiting on MorphOS/PowerPC with threading enabled
Attempt to fix heaptrc fos DOS.
Reword the heaptrc message if the corruption is spot incrementally.
Add heaptrc.KeepReleasedPercents.
Some heaptrc fixes: prevent TraceAllocMem from filling the memory twice, and fix the condition that decides whether to skip the backtrace collection in FreeMem.
Write empty traces as “Call trace for ...: N/A”.
Display class names in leak reports.
* Need to call DoneThread to allow memory manager to correctly release heap memory
Revisions in bigsets in this set 139fc803b40ef61f2747925b9a4e2eca7aa1e89e,3ac69995208dc36bb24a7747d51b127d80d28a95