[SDL] RLE Compression
donny.viszneki at gmail.com
Sun Apr 12 09:45:14 PDT 2009
On Sun, Apr 12, 2009 at 8:28 AM, Rudolf Janz <rudolf.janz at gmx.net> wrote:
>> That's a shame. shrinking the most recently allocated chunk of memory
>> should not cause memory fragmentation!
>> A good libc allocator should not have a hard time with either approach.
> It happens if there are other threads doing allocations.
This makes sense. I think for most applications, a better allocation
heuristic would be to accept a little more average overhead, and avoid
the memory fragmentation from concurrent allocator accesses by giving
each thread its own space within which to allocate. (There's certainly
room for more detailed heuristic analysis on how best to do that,
> But even without other allocations, if realloc does not move the memory block, the amount of contiguous virtual memory is reduced,
This is precisely the behavior I was criticizing. Good allocators
shouldn't do this.
> On Windows CE it is just 32MB with around 10-12 MB already prefragmented (because of an incredibly stupid shared library loading mechanism)
> In my case the avoiding the large estimates solved the out of memory problems.
More information about the SDL