Пример #1
0
        internal static unsafe void BrotliDecoderStateCleanup(ref BrotliDecoderState s)
        {
            BrotliDecoderStateCleanupAfterMetablock(ref s);

            s.free_func(s.memory_manager_opaque, s.ringbuffer);
            s.ringbuffer = null;
            s.free_func(s.memory_manager_opaque, s.block_type_trees);
            s.block_type_trees = null;
        }
Пример #2
0
        private static unsafe void BrotliDecoderStateCleanupAfterMetablock(ref BrotliDecoderState s)
        {
            s.free_func(s.memory_manager_opaque, s.context_modes);
            s.context_modes = null;
            s.free_func(s.memory_manager_opaque, s.context_map);
            s.context_map = null;
            s.free_func(s.memory_manager_opaque, s.dist_context_map);
            s.dist_context_map = null;

            fixed(HuffmanTreeGroup *lh = &s.literal_hgroup)
            fixed(HuffmanTreeGroup * ich = &s.insert_copy_hgroup)
            fixed(HuffmanTreeGroup * dh  = &s.distance_hgroup)
            {
                BrotliDecoderHuffmanTreeGroupRelease(ref s, lh);
                BrotliDecoderHuffmanTreeGroupRelease(ref s, ich);
                BrotliDecoderHuffmanTreeGroupRelease(ref s, dh);
            }
        }