Skip to content

Commit

Permalink
JACOBIN-575 Loading gfunctions into GMT. (Presently, done in parallel…
Browse files Browse the repository at this point in the history
… with regular loading to MTable. Eventually expect to remove MTable logic.)
  • Loading branch information
platypusguy committed Jan 14, 2025
1 parent 189c896 commit 6f78e5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/classloader/gmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

var GMT = make(gmt)

type gmt map[string]gmtEntry
type gmtEntry struct {
type gmt map[string]GmtEntry
type GmtEntry struct {
MethData interface{} // pointer to the method data
MType byte // method type, G = Go method, J = Java method
}
Expand Down Expand Up @@ -58,7 +58,7 @@ type gmtEntry struct {
var GMTmutex sync.Mutex

// adds an entry to the MTable, using a mutex
func GmtAddEntry(key string, mte gmtEntry) {
func GmtAddEntry(key string, mte GmtEntry) {
// fmt.Printf("DEBUG gmt.go AddEntry key=%s, gmtEntry=%s\n", key, string(mte.MType))
GMTmutex.Lock()
GMT[key] = mte
Expand Down
2 changes: 1 addition & 1 deletion src/config/buildno.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

package config

var BuildNo = 3416
var BuildNo = 3417
4 changes: 4 additions & 0 deletions src/gfunction/gfunction.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ func loadlib(tbl *classloader.MT, libMeths map[string]GMeth) {
}

classloader.AddEntry(tbl, key, tableEntry)
classloader.GmtAddEntry(key, classloader.GmtEntry{ // JACOBIN-575 adding to GMT in parallel
MethData: &gme,
MType: 'G',
})
}
if !ok {
exceptions.ThrowExNil(excNames.InternalException, "loadlib: at least one key was invalid")
Expand Down

0 comments on commit 6f78e5b

Please sign in to comment.