Skip to content

Commit

Permalink
chore: update Copyright header to CloudWeGo (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangmingLuo authored Jul 1, 2024
1 parent 85843f9 commit c089f8b
Show file tree
Hide file tree
Showing 186 changed files with 18,267 additions and 16,994 deletions.
1 change: 0 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ header:

paths:
- "**/*.go"
- "**/*.s"

paths-ignore:
- internal/binary/decoder/native_subr_amd64.go
Expand Down
9 changes: 9 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Typo check: https://github.com/crate-ci/typos

[files]
extend-exclude = ["go.mod", "go.sum", "fuzz/go.mod", "fuzz/go.sum"]

[default.extend-words]
Pn = "Pn"
worl = "worl"
rcall = "rcall"
56 changes: 28 additions & 28 deletions debug/debug.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 ByteDance Inc.
* Copyright 2022 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,47 +17,47 @@
package debug

import (
`github.com/cloudwego/frugal/internal/binary/decoder`
`github.com/cloudwego/frugal/internal/binary/encoder`
`github.com/cloudwego/frugal/internal/loader`
"github.com/cloudwego/frugal/internal/binary/decoder"
"github.com/cloudwego/frugal/internal/binary/encoder"
"github.com/cloudwego/frugal/internal/loader"
)

// A Stats records statistics about the JIT compiler.
type Stats struct {
Memory MemStats
Encoder CacheStats
Decoder CacheStats
Memory MemStats
Encoder CacheStats
Decoder CacheStats
}

// A MemStats records statistics about the memory allocator used in the JIT compiler.
type MemStats struct {
Alloc int
Count int
Alloc int
Count int
}

// A CacheStats records statistics about the type cache.
type CacheStats struct {
Hit int
Miss int
Size int
Hit int
Miss int
Size int
}

// GetStats returns statistics of the JIT compiler.
func GetStats() Stats {
return Stats {
Memory: MemStats {
Count: int(loader.FnCount),
Alloc: int(loader.LoadSize),
},
Encoder: CacheStats {
Hit : int(encoder.HitCount),
Miss : int(encoder.MissCount),
Size : int(encoder.TypeCount),
},
Decoder: CacheStats {
Hit : int(decoder.HitCount),
Miss : int(decoder.MissCount),
Size : int(decoder.TypeCount),
},
}
return Stats{
Memory: MemStats{
Count: int(loader.FnCount),
Alloc: int(loader.LoadSize),
},
Encoder: CacheStats{
Hit: int(encoder.HitCount),
Miss: int(encoder.MissCount),
Size: int(encoder.TypeCount),
},
Decoder: CacheStats{
Hit: int(decoder.HitCount),
Miss: int(decoder.MissCount),
Size: int(decoder.TypeCount),
},
}
}
14 changes: 7 additions & 7 deletions frugal.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 ByteDance Inc.
* Copyright 2022 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,23 +17,23 @@
package frugal

import (
`github.com/cloudwego/frugal/internal/binary/decoder`
`github.com/cloudwego/frugal/internal/binary/encoder`
`github.com/cloudwego/frugal/iov`
"github.com/cloudwego/frugal/internal/binary/decoder"
"github.com/cloudwego/frugal/internal/binary/encoder"
"github.com/cloudwego/frugal/iov"
)

// EncodedSize measures the encoded size of val.
func EncodedSize(val interface{}) int {
return encoder.EncodedSize(val)
return encoder.EncodedSize(val)
}

// EncodeObject serializes val into buf with Thrift Binary Protocol, with optional Zero-Copy iov.BufferWriter.
// buf must be large enough to contain the entire serialization result.
func EncodeObject(buf []byte, mem iov.BufferWriter, val interface{}) (int, error) {
return encoder.EncodeObject(buf, mem, val)
return encoder.EncodeObject(buf, mem, val)
}

// DecodeObject deserializes buf into val with Thrift Binary Protocol.
func DecodeObject(buf []byte, val interface{}) (int, error) {
return decoder.DecodeObject(buf, val)
return decoder.DecodeObject(buf, val)
}
2 changes: 1 addition & 1 deletion fuzz/builder/dynamic_struct.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/builder/dynamic_struct_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/builder/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/check.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/struct_fuzz.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/type.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 ByteDance Inc.
// Copyright 2022 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
16 changes: 8 additions & 8 deletions internal/atm/abi/abi.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 ByteDance Inc.
* Copyright 2022 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,24 +17,24 @@
package abi

import (
`unsafe`
"unsafe"

`github.com/cloudwego/frugal/internal/rt`
"github.com/cloudwego/frugal/internal/rt"
)

type AbstractABI interface {
RegisterMethod(id int, mt rt.Method) int
RegisterFunction(id int, fn interface{}) unsafe.Pointer
RegisterMethod(id int, mt rt.Method) int
RegisterFunction(id int, fn interface{}) unsafe.Pointer
}

var (
ABI = ArchCreateABI()
ABI = ArchCreateABI()
)

const (
PtrSize = 8 // pointer size
PtrSize = 8 // pointer size
)

func alignUp(n uintptr, a int) uintptr {
return (n + uintptr(a) - 1) &^ (uintptr(a) - 1)
return (n + uintptr(a) - 1) &^ (uintptr(a) - 1)
}
Loading

0 comments on commit c089f8b

Please sign in to comment.