Skip to content

Removes dead codes #2246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 0 additions & 224 deletions internal/bitpack/offset_array.go

This file was deleted.

34 changes: 0 additions & 34 deletions internal/bitpack/offset_array_test.go

This file was deleted.

23 changes: 0 additions & 23 deletions internal/platform/mremap_other.go

This file was deleted.

21 changes: 0 additions & 21 deletions internal/platform/mremap_unix.go

This file was deleted.

36 changes: 0 additions & 36 deletions internal/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,10 @@ func MmapCodeSegment(size int) ([]byte, error) {
}
}

// RemapCodeSegment reallocates the memory mapping of an existing code segment
// to increase its size. The previous code mapping is unmapped and must not be
// reused after the function returns.
//
// This is similar to mremap(2) on linux, and emulated on platforms which do not
// have this syscall.
//
// See https://man7.org/linux/man-pages/man2/mremap.2.html
func RemapCodeSegment(code []byte, size int) ([]byte, error) {
if size < len(code) {
panic("BUG: RemapCodeSegment with size less than code")
}
if code == nil {
return MmapCodeSegment(size)
}
if runtime.GOARCH == "amd64" {
return remapCodeSegmentAMD64(code, size)
} else {
return remapCodeSegmentARM64(code, size)
}
}

// MunmapCodeSegment unmaps the given memory region.
func MunmapCodeSegment(code []byte) error {
if len(code) == 0 {
panic("BUG: MunmapCodeSegment with zero length")
}
return munmapCodeSegment(code)
}

// mustMunmapCodeSegment panics instead of returning an error to the
// application.
//
// # Why panic?
//
// It is less disruptive to the application to leak the previous block if it
// could be unmapped than to leak the new block and return an error.
// Realistically, either scenarios are pretty hard to debug, so we panic.
func mustMunmapCodeSegment(code []byte) {
if err := munmapCodeSegment(code); err != nil {
panic(err)
}
}
Loading