Skip to content

Instantly share code, notes, and snippets.

View ozanh's full-sized avatar

Ozan Hacıbekiroğlu ozanh

View GitHub Profile
/*
dump-pagemap.c - Dump pagemap entries associated with mappings of a given process
Copyright 2021 Hilko Bengen <bengen@hilluzination.de>
License: GPL3 or later
Based on information from:
- linux/Documentation/filesystems/proc.txt
- linux/Documentation/admin-guide/mm/pagemap.rst
*/
@ozanh
ozanh / go-env-with-msys2.md
Created February 25, 2021 15:29 — forked from voidexp/go-env-with-msys2.md
Go development environment on Windows with MSYS2

Go development environment on Windows with MSYS2

Normally, it is sufficient to grab the Go MSI installer from the website in order to set up the toolchain. However, some packages that provide Go wrappers for C libraries rely on cgo tool, which in turn, needs the GCC toolchain in order to build the glue code. Also, 3rd-party dependencies are usually hosted on services like GitHub, thus Git is also needed. This mini-guide illustrates how to setup a convenient development environment on Windows using MSYS2.

@ozanh
ozanh / main.go
Last active May 12, 2020 02:40
Call Tengo CompiledFunction
package main
import (
"errors"
"fmt"
"sync"
"github.com/d5/tengo/v2"
"github.com/d5/tengo/v2/parser"
)
@ozanh
ozanh / bechmark_test.go
Created March 15, 2020 15:53
Benchmark of Tengo VM callable args allocation
package tengo_test
import (
"testing"
"github.com/d5/tengo/v2"
)
func BenchmarkCallAlloc(b *testing.B) {
scriptNoArg := `