]> Cypherpunks repositories - gostls13.git/commit
syscall: delay load of dll functions until they are called
authorAlex Brainman <alex.brainman@gmail.com>
Sun, 31 Jul 2011 10:07:04 +0000 (20:07 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Sun, 31 Jul 2011 10:07:04 +0000 (20:07 +1000)
commit9d7e39340d28482dc3a3d768308d475f69862987
tree7508fa1582cf9f03549ee5fbab1c5d8c6723ce63
parentbe96fa5a2e3e146a4bb4ba28f2b2c0f9c8e37b71
syscall: delay load of dll functions until they are called

Before this change, syscall package would load
all dlls used anywhere in the go tree on startup.
For example, this program:

package main

import "fmt"

func main() {
       fmt.Printf("Hello world\n")
}

would load these dlls

kernel32.dll
advapi32.dll
shell32.dll
wsock32.dll
ws2_32.dll
dnsapi.dll
iphlpapi.dll

Most of these dlls are network related and are not used
in this program. Now the same program loads only

kernel32.dll
shell32.dll

This decreases start times somewhat.

This also relaxes the rules of which dlls can be included
in the standard library. We could now include system calls
that are not available on all versions of Windows, because
we could decide if we should call them during runtime.

R=rsc, vcc.163
CC=golang-dev
https://golang.org/cl/4815046
src/pkg/exp/wingui/Makefile
src/pkg/exp/wingui/winapi.go
src/pkg/exp/wingui/zwinapi.go
src/pkg/syscall/mksyscall_windows.pl
src/pkg/syscall/syscall_windows.go
src/pkg/syscall/zsyscall_windows_386.go
src/pkg/syscall/zsyscall_windows_amd64.go