Re: memorymanager/fastmm question/suggestion
- From: "Pierre le Riche" <pleriche@xxxxxxxxxxx>
- Date: Sat, 29 Oct 2005 17:30:57 +0200
Hi Ben,
> would it make sense to have a FastSetLength(str,length,blocksize)
> function, where blocksize is a 'hint' to fastmm for the blocksize to
> allocate/reserve.
That wouldn't be hard to implement.
> thoughts? would it be worthwhile?
The problems I foresee are:
1) How do you prevent the memory manager from reallocating it to a smaller
block if the result of the first string addition is much smaller than
"blocksize"? I suppose you could have a flag in the block header that tells
it never to downsize that block.
2) It would slow down assignments of the type str1 := str2. To maintain a
minimum block size, strings will need to be copied more often (instead of
just bumping the reference count of str2).
3) It would require some changes to the RTL. If str1 is currently blank,
then something like str1 := str1 + str2 translates to str1 := str2, and the
RTL calls LStrAsg for that... again the reference count / copy problem..
Regards,
Pierre
--
Fastcode Project: http://www.fastcodeproject.org/
.
- Follow-Ups:
- Re: memorymanager/fastmm question/suggestion
- From: Ben Taylor
- Re: memorymanager/fastmm question/suggestion
- References:
- memorymanager/fastmm question/suggestion
- From: Ben Taylor [Team Indy]
- memorymanager/fastmm question/suggestion
- Prev by Date: Re: Webmaster - All Direct Calling Libraries is missing
- Next by Date: Re: Webmaster - All Direct Calling Libraries is missing
- Previous by thread: memorymanager/fastmm question/suggestion
- Next by thread: Re: memorymanager/fastmm question/suggestion
- Index(es):