Old 3rd August 2013, 00:19   #81
unixgeri
Junior Member
 
Join Date: Jun 2013
Posts: 27
many standard library realloc () are incorrect, I have therefore never used, I often have the fragmentation in my projects prevented either by unique allocation of a sufficiently large buffers, or by malloc and free (and retrieve it if it is necessary a larger buffer to allocate for example (10kb). So at start of scans alloc a probably large enough block, and if a new one is needed first check whether you need a bigger, if so then free () and then renewed malloc () when the required buffer smaller is then allocated to previously used again and again.
Excuse me, it's just a tip, I would not make me important.
unixgeri is offline   Reply With Quote
Old 3rd August 2013, 00:23   #82
DrO
 
Join Date: Sep 2003
Posts: 27,873
that's one of the things i'm intending to try out within the confines of how things currently work i.e. attempt to allocate things in one go, though i think trying to use something like a memory mapped file might instead be the better way to go (it's used for a few other things, but not the main bulk of the db handling and that's something the OS can help out with if i remember how all of that works - has been a decade since i last looked into such things). is just time that's the issue to try things out...
DrO is offline   Reply With Quote
Old 3rd August 2013, 00:33   #83
unixgeri
Junior Member
 
Join Date: Jun 2013
Posts: 27
caution the mmap (CreateFileMapping) win32 implementation is very very bad the fragmented os the total memory until pagefile is full. It is ok if you always need a couple of a few files.
unixgeri is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump