Skip to content

reflect: makeFunc#1148

Merged
xushiwei merged 3 commits intogoplus:mainfrom
visualfc:makefunc
Jun 16, 2025
Merged

reflect: makeFunc#1148
xushiwei merged 3 commits intogoplus:mainfrom
visualfc:makefunc

Conversation

@visualfc
Copy link
Member

@visualfc visualfc commented Jun 11, 2025

  • implement reflect.MakeFunc by libffi
  • GOOS=js add -sRESERVED_FUNCTION_POINTERS=1 for libffi

TODO libffi use c abi, ret struct type incorret

  • correct for reflect.MakeFunc.Call
  • correct for reflect.MakeFunc.Interface.(func ...)(...) for wasm32
  • incorrect for reflect.MakeFunc.Interface.(func ...)(...) for amd64
// c func
struct T {
    int n;
     int n1;
};

struct T demo2(int n) {
    struct T v = {100, 200};
    return v;
}

@visualfc visualfc marked this pull request as draft June 11, 2025 13:47
@codecov
Copy link

codecov bot commented Jun 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.62%. Comparing base (26aaa65) to head (2118849).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
internal/crosscompile/cosscompile.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1148      +/-   ##
==========================================
- Coverage   86.64%   86.62%   -0.02%     
==========================================
  Files          29       29              
  Lines        7343     7344       +1     
==========================================
  Hits         6362     6362              
- Misses        914      915       +1     
  Partials       67       67              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@visualfc visualfc marked this pull request as ready for review June 12, 2025 07:58
@visualfc visualfc changed the title [WIP] reflect: makeFunc reflect: makeFunc Jun 13, 2025
@xushiwei xushiwei merged commit e68355d into goplus:main Jun 16, 2025
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants