micha
347d71db10
* rtl/heap: optimization, while looking for a big enough block, also use blocks that are exactly large enough
...
git-svn-id: trunk@14420 -
2009-12-12 09:37:36 +00:00
micha
a6e6e9d453
* rtl/heap: fix SysReallocMem corruption in multi-thread use (thanks to Burkhard Carstens, #15323 )
...
git-svn-id: trunk@14419 -
2009-12-12 09:28:41 +00:00
Jonas Maebe
c1408d164f
* added some prefetch commands based on profile information about
...
l2 misses
git-svn-id: trunk@14197 -
2009-11-16 00:18:34 +00:00
Jonas Maebe
0597c300f4
* applied feature dependencies patch by Sven Barth from mantis #13673 :
...
o i386/i386.inc used a function (fpc_truely_ansistr_unique) is now
only included if FPC_HAS_FEATURE_ANSISTRINGS is enabled (all other
platforms use the Pascal-only implementations)
o inc/heap.inc relied on threading
o inc/threads.inc relied on exceptions, consoleio and stackcheck
o inc/system.inc: just a feature-related "variable not used"-hint
git-svn-id: trunk@13121 -
2009-05-09 20:08:57 +00:00
Jonas Maebe
533f533868
* changed destination parameter of getmem/getmemory from "var" to "out"
...
(mantis #11907 )
git-svn-id: trunk@13036 -
2009-04-25 09:57:29 +00:00
micha
82e9d9009d
* fix memory leak introduced in rev 9696, orphaned os chunks are not reused for short-lived threads (fixes issue #13173 )
...
git-svn-id: trunk@12759 -
2009-02-20 22:35:41 +00:00
micha
ae8289f9f7
* fix crash in case of main thread exiting simultaneously with other threads (issue #11006 )
...
git-svn-id: trunk@10492 -
2008-03-15 19:42:30 +00:00
Jonas Maebe
eb83213f10
* Only start recycling oschunks once MaxKeptOSChunks chuncks have
...
been allocated. E.g. allocate 100 blocks of 80 bytes and free them
all, then the same with blocks of 96, 112, 128, 144, 160 and 176
bytes, after which again 80 bytes -> previously, regardless of
the value of MaxKeptOSChunks, the empty block for 80 bytes was
reformatted for those of 96 bytes, then for 112 bytes etc. Now,
if MaxKeptOSChunks is set to 7, none will ever be reformatted
because enough chunks will be allocated from the OS.
git-svn-id: trunk@9696 -
2008-01-09 20:39:59 +00:00
Jonas Maebe
588822b14d
* more ptruint type casts to avoid 64 bit comparisons on 32 bit
...
platforms
git-svn-id: trunk@9693 -
2008-01-09 18:32:37 +00:00
Jonas Maebe
6dd8e51ee5
* folded a constant addition
...
* typecasted a subtraction's result to ptruint to avoid a needless
64 bit calculation on 32 bit platforms
git-svn-id: trunk@9673 -
2008-01-07 21:28:58 +00:00
peter
5acb3649df
* revert r9557, the performance impact is to big for an academic corner
...
case optimziation
git-svn-id: trunk@9603 -
2007-12-31 13:36:16 +00:00
yury
0dcad4d822
* Implemented late thread manager initialization. Thread manager code is not included to executable if thread stuff are not used. WinCE executable size is reduced by 4KB, Win32 executable size is reduced by 3KB. No testsuite regressions.
...
git-svn-id: trunk@9557 -
2007-12-28 14:40:28 +00:00
yury
e00bacdcef
* Removed HAS_MT_MEMORYMANAGER define, since it is obsolete now.
...
git-svn-id: trunk@9556 -
2007-12-28 11:30:46 +00:00
yury
eadfbb5027
* Removed unused local variable.
...
git-svn-id: trunk@9553 -
2007-12-27 23:49:35 +00:00
yury
b55501afef
* Removed dead code.
...
git-svn-id: trunk@9507 -
2007-12-21 23:23:55 +00:00
Jonas Maebe
b02fd37fbe
* removed some unused variables
...
git-svn-id: trunk@8399 -
2007-09-08 08:45:12 +00:00
Legolas
87d67dcad6
* gba and nds work with new heap manager now (no need for a custom heap manager that allocates a single big block anymore)
...
git-svn-id: trunk@8200 -
2007-07-30 15:37:19 +00:00
daniel
0c3a2a257d
* Convert heap to ptruint.
...
git-svn-id: trunk@7950 -
2007-07-04 19:46:47 +00:00
micha
b8822c88b5
* fix heap manager adding to wrong free list, and race condition
...
git-svn-id: trunk@7878 -
2007-06-30 21:13:48 +00:00
micha
cd1a283a18
* fix heap var size chunk search to be as intended (search constant number of blocks from best, not from any bigger)
...
git-svn-id: trunk@7807 -
2007-06-24 21:50:05 +00:00
micha
afb5f32f65
* fix heap block recycle flag when orphaning
...
git-svn-id: trunk@7805 -
2007-06-24 21:32:31 +00:00
micha
787f9a44c7
* heap manager: do not try to leave critical section twice, moron
...
git-svn-id: trunk@7763 -
2007-06-21 20:19:33 +00:00
micha
c0fa8fd255
* heap manager: fix thread exit race condition by using single global lock
...
fix finishing to be freed list in orphaned list context
fix heaptrace finalization
git-svn-id: trunk@7752 -
2007-06-20 21:10:35 +00:00
micha
c226f6fd44
* heap manager: handle freeing of block owned by exited thread
...
* heap trace: ditto
git-svn-id: trunk@7649 -
2007-06-13 20:27:42 +00:00
Jonas Maebe
20b99dade3
- reverted r7600, see additional comments in mantis #9027
...
git-svn-id: trunk@7606 -
2007-06-09 17:14:28 +00:00
Jonas Maebe
5a8679131f
+ support for new/dispose with extra size parameter in macpas mode
...
(mantis #9027 )
git-svn-id: trunk@7600 -
2007-06-08 18:02:31 +00:00
micha
f3a22cbab4
* simplify/remove some code
...
git-svn-id: trunk@7533 -
2007-05-30 19:05:07 +00:00
micha
eaa598094e
* heap manager: do not access chunk after last one
...
git-svn-id: trunk@7497 -
2007-05-28 15:06:19 +00:00
micha
0248d2472d
* heap manager: fix os chunk list nonsense
...
fix usage statistics for variable sized chunks
fix var chunks free space fragmentation
git-svn-id: trunk@7491 -
2007-05-27 19:04:02 +00:00
micha
f9d2ea7e3a
* heap manager: fix shrinking var sized chunks to very small sizes < sizeof(tmemchunk_var)
...
was no problem previously due to sizeof(tmemchunk_var) <= blocksize
git-svn-id: trunk@7464 -
2007-05-25 07:05:33 +00:00
micha
9f11556f10
* flush output after heap debug writeln at exit
...
git-svn-id: trunk@7413 -
2007-05-21 20:38:29 +00:00
micha
6c85fcb157
heap manager: initialize critical sections properly
...
git-svn-id: trunk@7412 -
2007-05-21 17:08:28 +00:00
micha
7f2a257102
+ heap manager now per thread, reduce heap lock contention
...
+ heap threading test
git-svn-id: trunk@7407 -
2007-05-20 20:58:12 +00:00
micha
bb9de8f193
* SHOW_MEM_USAGE define to always show maximum heap size used/allocated, independent of DUMP_MEM_USAGE
...
git-svn-id: trunk@7324 -
2007-05-13 12:34:16 +00:00
micha
4579c242df
* heap manager: look for better matching variable block size, with upperbound search
...
git-svn-id: trunk@7320 -
2007-05-12 20:52:08 +00:00
micha
aa951460a5
+ heap manager size statistics
...
git-svn-id: trunk@7319 -
2007-05-12 20:50:33 +00:00
micha
09a60a4019
* tiny optimization to heap manager: implement freeoslist as a fifo (instead of lifo) which should allow more os chunks to keep their fixed size formatting in case of diverse fixed size usage
...
git-svn-id: trunk@7237 -
2007-05-02 05:20:44 +00:00
micha
9c727d1762
* tiny optimization to heap manager, avoid repeated removing/readding to freeoslist overhead
...
git-svn-id: trunk@7236 -
2007-05-01 21:04:18 +00:00
micha
e30a47723b
* heap manager micro optimizations
...
git-svn-id: trunk@7219 -
2007-04-30 20:23:46 +00:00
micha
9bdde01a99
* avoid usage of freelists_free_chunk boolean, while still prevent repeated fixed size conversion overhead; should reduce memory usage in some cases
...
git-svn-id: trunk@7203 -
2007-04-30 12:52:28 +00:00
yury
3c10856a4f
* Dont throw runerrors in default MemoryMutexManager if HAS_MT_MEMORYMANAGER is defined.
...
git-svn-id: trunk@5962 -
2007-01-14 01:14:12 +00:00
Legolas
9e6d19a494
* rtl part of first Nintendo DS port
...
git-svn-id: trunk@5593 -
2006-12-14 17:34:51 +00:00
Jonas Maebe
64b7f00afd
* fixed ReturnNilIfGrowHeapFails
...
git-svn-id: trunk@5042 -
2006-10-28 18:17:34 +00:00
micha
dc3b37ff73
+ heap manager: reduce overhead on fixed size chunks from 8 to 4
...
git-svn-id: trunk@4904 -
2006-10-14 15:05:24 +00:00
Legolas
19d597f425
* Reactivated heap management for GBA
...
git-svn-id: trunk@4529 -
2006-09-01 17:54:59 +00:00
florian
d337c3ca6a
* clean up heap at exit, fixes #7183
...
git-svn-id: trunk@4410 -
2006-08-11 22:09:29 +00:00
peter
b3732f7215
* keep same fixed block, also if we resize to a smaller size.
...
git-svn-id: trunk@4313 -
2006-07-30 15:02:28 +00:00
yury
e062922528
* added an option to use target-specific memory manager instead of standard. This is controlled by HAS_MEMORYMANAGER and HAS_MT_MEMORYMANAGER defines.
...
* wince executables use C memory manager now (as all apps compiled by eVC++). It saves 5.5 KB of exe size.
git-svn-id: trunk@4282 -
2006-07-23 10:23:31 +00:00
florian
5575a837db
* gba patch from Francesco Lombardi
...
git-svn-id: trunk@3716 -
2006-05-28 14:48:24 +00:00
peter
4b7f51b0aa
* fixed uninitialized var
...
git-svn-id: trunk@2654 -
2006-02-20 11:24:38 +00:00