memorymanager/fastmm question/suggestion
- From: "Ben Taylor [Team Indy]" <to_ben@xxxxxxxxx>
- Date: Sat, 29 Oct 2005 22:16:07 +1300
Hi,
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.
the intent is, in a situation where you know you'll be appending data to a string up to a particular size, you could reserve enough space so as the string increases in length, it becomes an in-place realloc, instead of a possible move..
eg
FastSetLength(s,0,10000); //now length(s)=0, but its actually has a 10k block of memory available. //append data to the string. there should be no move. for i:=1 to 9000 do s:=s+'x';
if you know what i mean.. if it needs more space, it would then be a normal move/realloc as required.
thoughts? would it be worthwhile? .
- Follow-Ups:
- Re: memorymanager/fastmm question/suggestion
- From: Ivo Bauer
- Re: memorymanager/fastmm question/suggestion
- From: Avatar Zondertau
- Re: memorymanager/fastmm question/suggestion
- From: Dan Downs
- Re: memorymanager/fastmm question/suggestion
- From: Pierre le Riche
- Re: memorymanager/fastmm question/suggestion
- Prev by Date: Re: FastCode MM B&V 0.54
- Next by Date: Re: Delphi 3: Efficient squareroot computation/How to use SSE commands in inline asm?
- Previous by thread: Performance Bottlenecks
- Next by thread: Re: memorymanager/fastmm question/suggestion
- Index(es):
Relevant Pages
|