Page MenuHome

Writes a GZip file directly (instead of writing, then compressing)
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Sep 3 2014, 3:08 PM.

Details

Summary

This patch uses gzip's API to avoid writing uncompressed, then compressing.

Note that I dont really like passing both the gzip file handle and the regular file handle, but its only to a few functions, so its not that bad.

Diff Detail

Event Timeline

Campbell Barton (campbellbarton) retitled this revision from to Writes a GZip file directly (instead of writing, then compressing).
Campbell Barton (campbellbarton) set the repository for this revision to rB Blender.

I agree with your comment about the filehandles being not super pretty but to me this makes so much sense that I just end up wondering why we ever did it the other way around. :)

Save our SSDs, trunk !

source/blender/blenloader/intern/writefile.c
204

Ideally storage should be more generic as well. It'll be stupid to store all the handles needed for any compression algo here. Could be either void* and INT_AS_PTR magic, or just structs like we've got in modifiers. Or just void* to own allocated struct.

211

Personally i'd just inline this (wc)->user_data.file_handle, don't see huge benefit of doing macro stuff here.

268

That's not create, that's init. Create is associating with allocating something or so.