Пример #1
0
 public common(sync.RWMutex mu = default, slice<byte> output = default, io.Writer w = default, bool ran = default, bool failed = default, bool skipped = default, bool done = default, Action cleanup = default, @string cleanupName = default, slice<System.UIntPtr> cleanupPc = default, bool chatty = default, bool bench = default, bool finished = default, int hasSub = default, long raceErrors = default, @string runner = default, ref ptr<common> parent = default, long level = default, slice<System.UIntPtr> creator = default, @string name = default, time.Time start = default, time.Duration duration = default, channel<bool> barrier = default, channel<bool> signal = default, slice<ptr<T>> sub = default, sync.Once tempDirOnce = default, @string tempDir = default, error tempDirErr = default, int tempDirSeq = default)
 {
     this.mu = mu;
     this.output = output;
     this.w = w;
     this.ran = ran;
     this.failed = failed;
     this.skipped = skipped;
     this.done = done;
     this.cleanup = cleanup;
     this.cleanupName = cleanupName;
     this.cleanupPc = cleanupPc;
     this.chatty = chatty;
     this.bench = bench;
     this.finished = finished;
     this.hasSub = hasSub;
     this.raceErrors = raceErrors;
     this.runner = runner;
     this.parent = parent;
     this.level = level;
     this.creator = creator;
     this.name = name;
     this.start = start;
     this.duration = duration;
     this.barrier = barrier;
     this.signal = signal;
     this.sub = sub;
     this.tempDirOnce = tempDirOnce;
     this.tempDir = tempDir;
     this.tempDirErr = tempDirErr;
     this.tempDirSeq = tempDirSeq;
 }
Пример #2
0
 public sanity(io.Writer reporter = default, ref ptr <Function> fn = default, ref ptr <BasicBlock> block = default, bool insane = default)
 {
     this.reporter = reporter;
     this.fn       = fn;
     this.block    = block;
     this.insane   = insane;
 }
Пример #3
0
                            // NewEncoder returns a new Encoder which performs HPACK encoding. An
                            // encoded data is written to w.
                            public static ptr <Encoder> NewEncoder(io.Writer w)
                            {
                                ptr <Encoder> e = addr(new Encoder(minSize: uint32Max, maxSizeLimit: initialHeaderTableSize, tableSizeUpdate: false, w: w, ));

                                e.dynTab.table.init();
                                e.dynTab.setMaxSize(initialHeaderTableSize);
                                return(_addr_e !);
                            }
Пример #4
0
 public encoder(error err = default, io.Writer w = default, array <byte> buf = default, long nbuf = default, array <byte> @out = default)
 {
     this.err  = err;
     this.w    = w;
     this.buf  = buf;
     this.nbuf = nbuf;
     this.@out = @out;
 }
Пример #5
0
 public Writer(bool Binary = default, io.Writer w = default, long i = default, array <byte> line = default, bool cr = default)
 {
     this.Binary = Binary;
     this.w      = w;
     this.i      = i;
     this.line   = line;
     this.cr     = cr;
 }
Пример #6
0
 public dumper(io.Writer output = default, map <Node, long> ptrmap = default, long indent = default, byte last = default, long line = default)
 {
     this.output = output;
     this.ptrmap = ptrmap;
     this.indent = indent;
     this.last   = last;
     this.line   = line;
 }
Пример #7
0
 public state(ref ptr <Template> tmpl = default, io.Writer wr = default, parse.Node node = default, slice <variable> vars = default, long depth = default)
 {
     this.tmpl  = tmpl;
     this.wr    = wr;
     this.node  = node;
     this.vars  = vars;
     this.depth = depth;
 }
Пример #8
0
 public Writer(io.Writer w = default, Transformer t = default, slice <byte> dst = default, slice <byte> src = default, long n = default)
 {
     this.w   = w;
     this.t   = t;
     this.dst = dst;
     this.src = src;
     this.n   = n;
 }
Пример #9
0
            // NewEncoder returns a new encoder that will transmit on the io.Writer.
            public static ptr <Encoder> NewEncoder(io.Writer w)
            {
                ptr <Encoder> enc = @new <Encoder>();

                enc.w          = new slice <io.Writer>(new io.Writer[] { w });
                enc.sent       = make_map <reflect.Type, typeId>();
                enc.countState = enc.newEncoderState(@new <encBuffer>());
                return(_addr_enc !);
            }
Пример #10
0
 public dumper(io.Writer w = default, array <byte> rightChars = default, array <byte> buf = default, long used = default, ulong n = default, bool closed = default)
 {
     this.w          = w;
     this.rightChars = rightChars;
     this.buf        = buf;
     this.used       = used;
     this.n          = n;
     this.closed     = closed;
 }
Пример #11
0
 public Encoder(io.Writer w = default, error err = default, bool escapeHTML = default, ref ptr <bytes.Buffer> indentBuf = default, @string indentPrefix = default, @string indentValue = default)
 {
     this.w            = w;
     this.err          = err;
     this.escapeHTML   = escapeHTML;
     this.indentBuf    = indentBuf;
     this.indentPrefix = indentPrefix;
     this.indentValue  = indentValue;
 }
Пример #12
0
 public lineWrapper(io.Writer @out = default, bool printed = default, long width = default, @string indent = default, long n = default, long pendSpace = default)
 {
     this.@out      = @out;
     this.printed   = printed;
     this.width     = width;
     this.indent    = indent;
     this.n         = n;
     this.pendSpace = pendSpace;
 }
Пример #13
0
 public Writer(io.Writer w = default, long pad = default, fileWriter curr = default, Header hdr = default, block blk = default, error err = default)
 {
     this.w    = w;
     this.pad  = pad;
     this.curr = curr;
     this.hdr  = hdr;
     this.blk  = blk;
     this.err  = err;
 }
Пример #14
0
 public printer(io.Writer output = default, ref ptr <token.FileSet> fset = default, FieldFilter filter = default, long indent = default, byte last = default, long line = default)
 {
     this.output = output;
     this.fset   = fset;
     this.filter = filter;
     this.indent = indent;
     this.last   = last;
     this.line   = line;
 }
Пример #15
0
 public fileWriter(ref header header = default, io.Writer zipw = default, ref ptr <countWriter> rawCount = default, io.WriteCloser comp = default, ref ptr <countWriter> compCount = default, hash.Hash32 crc32 = default, bool closed = default)
 {
     this.m_headerRef = new ptr <header>(ref header);
     this.zipw        = zipw;
     this.rawCount    = rawCount;
     this.comp        = comp;
     this.compCount   = compCount;
     this.crc32       = crc32;
     this.closed      = closed;
 }
Пример #16
0
 public printer(io.Writer output = default, long written = default, bool linebreaks = default, long indent = default, long nlcount = default, slice <whitespace> pending = default, token lastTok = default)
 {
     this.output     = output;
     this.written    = written;
     this.linebreaks = linebreaks;
     this.indent     = indent;
     this.nlcount    = nlcount;
     this.pending    = pending;
     this.lastTok    = lastTok;
 }
Пример #17
0
 public dumper(io.Writer output = default, ref ptr <regexp.Regexp> fieldrx = default, map <System.UIntPtr, long> ptrmap = default, @string lastadr = default, long indent = default, byte last = default, long line = default)
 {
     this.output  = output;
     this.fieldrx = fieldrx;
     this.ptrmap  = ptrmap;
     this.lastadr = lastadr;
     this.indent  = indent;
     this.last    = last;
     this.line    = line;
 }
Пример #18
0
 public Writer(io.Writer w = default, long level = default, slice <byte> dict = default, ref ptr <flate.Writer> compressor = default, hash.Hash32 digest = default, error err = default, array <byte> scratch = default, bool wroteHeader = default)
 {
     this.w           = w;
     this.level       = level;
     this.dict        = dict;
     this.compressor  = compressor;
     this.digest      = digest;
     this.err         = err;
     this.scratch     = scratch;
     this.wroteHeader = wroteHeader;
 }
Пример #19
0
 public Writer(Header Header = default, io.Writer w = default, long level = default, bool wroteHeader = default, ref ptr <flate.Writer> compressor = default, uint digest = default, uint size = default, bool closed = default, array <byte> buf = default, error err = default)
 {
     this.Header      = Header;
     this.w           = w;
     this.level       = level;
     this.wroteHeader = wroteHeader;
     this.compressor  = compressor;
     this.digest      = digest;
     this.size        = size;
     this.closed      = closed;
     this.buf         = buf;
     this.err         = err;
 }
Пример #20
0
 public Package(io.Writer writer = default, @string name = default, @string userPath = default, ref ptr <ast.Package> pkg = default, ref ptr <ast.File> file = default, ref ptr <doc.Package> doc = default, ref ptr <build.Package> build = default, map <ptr <doc.Value>, bool> typedValue = default, map <ptr <doc.Func>, bool> constructor = default, ref ptr <token.FileSet> fs = default, pkgBuffer buf = default)
 {
     this.writer      = writer;
     this.name        = name;
     this.userPath    = userPath;
     this.pkg         = pkg;
     this.file        = file;
     this.doc         = doc;
     this.build       = build;
     this.typedValue  = typedValue;
     this.constructor = constructor;
     this.fs          = fs;
     this.buf         = buf;
 }
Пример #21
0
 // Escape comment text for HTML. If nice is set,
 // also turn `` into &ldquo; and '' into &rdquo;.
 private static void commentEscape(io.Writer w, @string text, bool nice)
 {
     if (nice)
     {
         // In the first pass, we convert `` and '' into their unicode equivalents.
         // This prevents them from being escaped in HTMLEscape.
         text = convertQuotes(text);
         ref bytes.Buffer buf = ref heap(out ptr <bytes.Buffer> _addr_buf);
         template.HTMLEscape(_addr_buf, (slice <byte>)text);
         // Now we convert the unicode quotes to their HTML escaped entities to maintain old behavior.
         // We need to use a temp buffer to read the string back and do the conversion,
         // otherwise HTMLEscape will escape & to &amp;
         htmlQuoteReplacer.WriteString(w, buf.String());
         return;
     }
Пример #22
0
 public Writer(io.Writer output = default, long minwidth = default, long tabwidth = default, long padding = default, array <byte> padbytes = default, ulong flags = default, slice <byte> buf = default, long pos = default, cell cell = default, byte endChar = default, slice <slice <cell> > lines = default, slice <long> widths = default)
 {
     this.output   = output;
     this.minwidth = minwidth;
     this.tabwidth = tabwidth;
     this.padding  = padding;
     this.padbytes = padbytes;
     this.flags    = flags;
     this.buf      = buf;
     this.pos      = pos;
     this.cell     = cell;
     this.endChar  = endChar;
     this.lines    = lines;
     this.widths   = widths;
 }
 public huffmanBitWriter(io.Writer writer = default, ulong bits = default, ulong nbits = default, array <byte> bytes = default, array <int> codegenFreq = default, long nbytes = default, slice <int> literalFreq = default, slice <int> offsetFreq = default, slice <byte> codegen = default, ref ptr <huffmanEncoder> literalEncoding = default, ref ptr <huffmanEncoder> offsetEncoding = default, ref ptr <huffmanEncoder> codegenEncoding = default, error err = default)
 {
     this.writer          = writer;
     this.bits            = bits;
     this.nbits           = nbits;
     this.bytes           = bytes;
     this.codegenFreq     = codegenFreq;
     this.nbytes          = nbytes;
     this.literalFreq     = literalFreq;
     this.offsetFreq      = offsetFreq;
     this.codegen         = codegen;
     this.literalEncoding = literalEncoding;
     this.offsetEncoding  = offsetEncoding;
     this.codegenEncoding = codegenEncoding;
     this.err             = err;
 }
Пример #24
0
 public encoder(ref ptr <Encoder> enc = default, io.Writer w = default, image.Image m = default, long cb = default, error err = default, array <byte> header = default, array <byte> footer = default, array <byte> tmp = default, array <slice <byte> > cr = default, slice <byte> pr = default, ref ptr <zlib.Writer> zw = default, long zwLevel = default, ref ptr <bufio.Writer> bw = default)
 {
     this.enc     = enc;
     this.w       = w;
     this.m       = m;
     this.cb      = cb;
     this.err     = err;
     this.header  = header;
     this.footer  = footer;
     this.tmp     = tmp;
     this.cr      = cr;
     this.pr      = pr;
     this.zw      = zw;
     this.zwLevel = zwLevel;
     this.bw      = bw;
 }
Пример #25
0
 // Help implements the 'help' command.
 public static void Help(io.Writer w, slice <@string> args)
 {
     // 'go help documentation' generates doc.go.
     if (len(args) == 1L && args[0L] == "documentation")
     {
         fmt.Fprintln(w, "// Copyright 2011 The Go Authors. All rights reserved.");
         fmt.Fprintln(w, "// Use of this source code is governed by a BSD-style");
         fmt.Fprintln(w, "// license that can be found in the LICENSE file.");
         fmt.Fprintln(w);
         fmt.Fprintln(w, "// Code generated by mkalldocs.sh; DO NOT EDIT.");
         fmt.Fprintln(w, "// Edit the documentation in other files and rerun mkalldocs.sh to generate this one.");
         fmt.Fprintln(w);
         ptr <object> buf = @new <bytes.Buffer>();
         PrintUsage(buf, [email protected]);
         ptr <base.Command> usage = addr(new base.Command(Long: buf.String()));
         ptr <base.Command> cmds  = new slice <ptr <base.Command> >(new ptr <base.Command>[] { usage });
Пример #26
0
                    // fdump prints the structure of a rooted data structure
                    // to w by depth-first traversal of the data structure.
                    //
                    // The filter parameter is a regular expression. If it is
                    // non-empty, only struct fields whose names match filter
                    // are printed.
                    //
                    // The depth parameter controls how deep traversal recurses
                    // before it returns (higher value means greater depth).
                    // If an empty field filter is given, a good depth default value
                    // is 4. A negative depth means no depth limit, which may be fine
                    // for small data structures or if there is a non-empty filter.
                    //
                    // In the output, Node structs are identified by their Op name
                    // rather than their type; struct fields with zero values or
                    // non-matching field names are omitted, and "…" means recursion
                    // depth has been reached or struct fields have been omitted.
                    private static void fdump(io.Writer w, object root, @string filter, long depth)
                    {
                        if (root == null)
                        {
                            fmt.Fprintln(w, "nil");
                            return;
                        }

                        if (filter == "")
                        {
                            filter = ".*"; // default
                        }

                        dumper p = new dumper(output: w, fieldrx: regexp.MustCompile(filter), ptrmap: make(map[uintptr] int), last: '\n', );

                        p.dump(reflect.ValueOf(root), depth);
                        p.printf("\n");
                    }
Пример #27
0
            // writeHeapProto writes the current heap profile in protobuf format to w.
            private static error writeHeapProto(io.Writer w, slice <runtime.MemProfileRecord> p, long rate, @string defaultSampleType)
            {
                var b = newProfileBuilder(w);

                b.pbValueType(tagProfile_PeriodType, "space", "bytes");
                b.pb.int64Opt(tagProfile_Period, rate);
                b.pbValueType(tagProfile_SampleType, "alloc_objects", "count");
                b.pbValueType(tagProfile_SampleType, "alloc_space", "bytes");
                b.pbValueType(tagProfile_SampleType, "inuse_objects", "count");
                b.pbValueType(tagProfile_SampleType, "inuse_space", "bytes");
                if (defaultSampleType != "")
                {
                    b.pb.int64Opt(tagProfile_DefaultSampleType, b.stringIndex(defaultSampleType));
                }
                long          values = new slice <long>(new long[] { 0, 0, 0, 0 });
                slice <ulong> locs   = default;

                foreach (var(_, r) in p)
                {
                    var hideRuntime = true;
                    for (long tries = 0L; tries < 2L; tries++)
                    {
                        var stk = r.Stack();
                        // For heap profiles, all stack
                        // addresses are return PCs, which is
                        // what appendLocsForStack expects.
                        if (hideRuntime)
                        {
                            foreach (var(i, addr) in stk)
                            {
                                {
                                    var f = runtime.FuncForPC(addr);

                                    if (f != null && strings.HasPrefix(f.Name(), "runtime."))
                                    {
                                        continue;
                                    }
                                }
                                // Found non-runtime. Show any runtime uses above it.
                                stk = stk[i..];
Пример #28
0
 // printSource prints an annotated source listing, include all
 // functions with samples that match the regexp rpt.options.symbol.
 // The sources are sorted by function name and then by filename to
 // eliminate potential nondeterminism.
 private static error printSource(io.Writer w, ptr<Report> _addr_rpt)
 {
     ref Report rpt = ref _addr_rpt.val;
Пример #29
0
 public stringWriter(io.Writer w = default)
 {
     this.w = w;
 }
Пример #30
0
 public dictWriter(io.Writer w = default)
 {
     this.w = w;
 }