Skip to content

Commit a44255f

Browse files
authored
Fix explicit template instantiations in zlib-util.c++ (#4023)
1 parent 92a0631 commit a44255f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/workerd/api/node/zlib-util.c++

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -927,28 +927,20 @@ void ZlibUtil::brotliWithCallback(
927927

928928
#ifndef CREATE_TEMPLATE
929929
#define CREATE_TEMPLATE(T) \
930-
template void ZlibUtil::CompressionStream<T>::reset(jsg::Lock& js); \
930+
template class ZlibUtil::CompressionStream<T>; \
931931
template void ZlibUtil::CompressionStream<T>::write<false>(jsg::Lock & js, int flush, \
932932
jsg::Optional<kj::Array<kj::byte>> input, int inputOffset, int inputLength, \
933933
kj::Array<kj::byte> output, int outputOffset, int outputLength); \
934934
template void ZlibUtil::CompressionStream<T>::write<true>(jsg::Lock & js, int flush, \
935935
jsg::Optional<kj::Array<kj::byte>> input, int inputOffset, int inputLength, \
936-
kj::Array<kj::byte> output, int outputOffset, int outputLength); \
937-
template jsg::Ref<ZlibUtil::CompressionStream<T>> ZlibUtil::CompressionStream<T>::constructor( \
938-
jsg::Lock& js, ZlibModeValue mode);
936+
kj::Array<kj::byte> output, int outputOffset, int outputLength);
939937

940938
CREATE_TEMPLATE(ZlibContext)
941939
CREATE_TEMPLATE(BrotliEncoderContext)
942940
CREATE_TEMPLATE(BrotliDecoderContext)
943941

944-
template jsg::Ref<ZlibUtil::BrotliCompressionStream<BrotliEncoderContext>> ZlibUtil::
945-
BrotliCompressionStream<BrotliEncoderContext>::constructor(jsg::Lock& js, ZlibModeValue mode);
946-
template jsg::Ref<ZlibUtil::BrotliCompressionStream<BrotliDecoderContext>> ZlibUtil::
947-
BrotliCompressionStream<BrotliDecoderContext>::constructor(jsg::Lock& js, ZlibModeValue mode);
948-
template bool ZlibUtil::BrotliCompressionStream<BrotliEncoderContext>::initialize(
949-
jsg::Lock&, jsg::BufferSource, jsg::BufferSource, jsg::Function<void()>);
950-
template bool ZlibUtil::BrotliCompressionStream<BrotliDecoderContext>::initialize(
951-
jsg::Lock&, jsg::BufferSource, jsg::BufferSource, jsg::Function<void()>);
942+
template class ZlibUtil::BrotliCompressionStream<BrotliEncoderContext>;
943+
template class ZlibUtil::BrotliCompressionStream<BrotliDecoderContext>;
952944

953945
template kj::Array<kj::byte> ZlibUtil::brotliSync<BrotliEncoderContext>(
954946
jsg::Lock& js, InputSource data, BrotliContext::Options opts);

0 commit comments

Comments
 (0)