Coder Social home page Coder Social logo

Comments (35)

HuJianChong avatar HuJianChong commented on July 21, 2024

+1

from wax.

KimReboot avatar KimReboot commented on July 21, 2024

+1

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

+1

from wax.

maxfong avatar maxfong commented on July 21, 2024

+10086

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

I figured out how to compile wax_stdlib with 64bits support, take a look guys
https://github.com/felipejfc/wax_x86-64

However there is still work to do, the library is being successfully loaded but it is not working as expected yet, the method pcallUserdata on it's 5th call is making reference to a invalid address in memory and I can't figure out why yet. I invite you all to try to fix this. Later today I'll update the readme on my fork with the instructions of how I've compiled for 64 bit but you can start debugging with the precompiled one to find why it is not working and fell free to push fixes. remember to compile the projects in ARM64.

Regards

from wax.

maxfong avatar maxfong commented on July 21, 2024

i try compiled wax_stdlib.h 64-bit
https://github.com/maxfong/wax_stdlib_x64

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

does this work?
I can compile and load the lib but still I get a crash in method wax_fromInstance
do you got it to work?

I always get EXC_BAD_ACCESS code=1

regards

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

Friends, I've got it fully working on both architectures, here you go:

https://github.com/felipejfc/wax_x86-64

Regards!

from wax.

maxfong avatar maxfong commented on July 21, 2024

int size = wax_fromObjc(L, type, usedArgs); -> int size = wax_sizeOfTypeDescription(type); fix crash...

from wax.

linmingzhi avatar linmingzhi commented on July 21, 2024

download wax_x86-64 ,in States (without wax.framework), try on iphone5 (hardware support 32bit),it run ok. but on iphone6plue (hardware support 32bit and 64bit),it crash ,in wax_helpers.m , "if ([instance isKindOfClass:[NSString class]]) {" thread 1:EXC_BAD_ACCESS(code=1,address=0x81a59408e1b9)

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

strange, I can run well here on iphone 6 simulator!

from wax.

linmingzhi avatar linmingzhi commented on July 21, 2024

iphone 6 simulator run OK,but iphone 6 machine run crash 。 With the above question。

from wax.

maxfong avatar maxfong commented on July 21, 2024

@felipejfc Thanks,my wax_stdlib_x64 Only how create wax_stdlib_x64.h file;
my WaxPatch_X64 using your's wax_x86-64 find iphone6 crash, if change int size = wax_fromObjc(L, type, usedArgs); to int size = wax_sizeOfTypeDescription(type); ,Some features are not available。。。

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

If you change this line you'll miss some features @maxfong, I'm aware of the bug now @linmingzhi, I'm getting crash now using a device too... I'll try to figure it out! THe problem lies in grabbing va_list

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

I've put a description on the problem in my repo

https://github.com/felipejfc/wax_x86-64

from wax.

maxfong avatar maxfong commented on July 21, 2024

HI,@felipejfc, i test your's code,find arm64 device,lua using OC delegate run crash and wax examples run crash,thank you for your efforts :>,come on

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@maxfong I'm aware of the issues, I'm currently working on a fix, I can already access the arguments but I need to fix an issue with pointers... I'm very near of fixing it, keep an eye on it

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@linmingzhi @maxfong it must be fully working now, can you guys confirm?

regards!

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

Oh well I guess I identified another issue with multiple arguments method calls that is not covered by the tests --''
I'll be fixing it later

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

Ok, now I think it is really working @linmingzhi @maxfong @KimReboot @HuJianChong https://github.com/felipejfc/wax_x86-64

I managed to run tests and examples

from wax.

maxfong avatar maxfong commented on July 21, 2024

@felipejfc ,if i // for (int i = 0; i < n-2; i++) { free(sharedMemoryForArgs[i]); },it will work OK,THX

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@maxfong If you free then it don't work? I think it's better to free them to avoid a memory leak... It works OK here even freeing the args, can you provide a code where freeing causes problems?

from wax.

maxfong avatar maxfong commented on July 21, 2024

@felipejfc my repo:https://github.com/maxfong/WaxPatch_X64/tree/develop, run develop branch, for free sharedMemoryForArgs will crash

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@maxfong it is true that it was causing a crash, I released a new commit with fix for that, the arguments needs to be freed so that no memory leak occurs. can you try it?

from wax.

linmingzhi avatar linmingzhi commented on July 21, 2024

NSMutableString *pp = [[NSMutableString alloc] init];
NSString *dir = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:modeName];
NSArray *fileList = [fileManager contentsOfDirectoryAtPath:dir error:&error];
for (NSString *file in fileList) {
//load A lot of resources (.lua) in the file
[pp appendFormat:@"%@/?.lua;",[dir stringByAppendingPathComponent:file]];
}
[pp appendFormat:@"%@/?/%@",dir,[[dir stringByAppendingPathComponent:[dic objectForKey:@""]] stringByAppendingPathComponent:[dic objectForKey:@"Enter"]]];
setenv(LUA_PATH, [pp UTF8String], 1);
wax_start((char *)[[dic objectForKey:@"Enter"] UTF8String], nil);

then causing a crash ../stdlib/waxClass.lua:28: Can't override method with return type d .And @maxfong is a bit similar ---run develop branch, for free sharedMemoryForArgs will crash

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@linmingzhi can you provide more information on this crash? what are you trying to do? are you using my last repo version? I've already solved the problem @maxfong pointed for sharedMemoryForArgs

from wax.

maxfong avatar maxfong commented on July 21, 2024

HI @linmingzhi , @felipejfc did
// for (int i = 0; i < n-2; i++) {
// free(sharedMemoryForArgs[i]);
// }
//
// free(sharedMemoryForArgs);

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@maxfong @linmingzhi felipejfc@45bbb5e

To avoid memory leak!

from wax.

IPv6 avatar IPv6 commented on July 21, 2024

trying to use https://github.com/felipejfc/n-wax to replace wax with 64bit-enabled one.
but i cant compile my app (

  1. build using "master branch" fails with linker error
Undefined symbols for architecture arm64:
  "_ffi_type_pointer", referenced from:
      _overrideMethod in wax_instance.o
  "_ffi_typeForTypeEncoding", referenced from:
      _overrideMethod in wax_instance.o
  "_createFFIClosure", referenced from:
      _overrideMethod in wax_instance.o
ld: symbol(s) not found for architecture arm64
  1. build with "no-ffi" branch fails with linker errors
Undefined symbols for architecture armv7:
  "_NewArgumentList", referenced from:
      _myForwardInvocation in wax_instance.o
  "_addArgument", referenced from:
      _myForwardInvocation in wax_instance.o
  "_freeArguments", referenced from:
      _myForwardInvocation in wax_instance.o
ld: symbol(s) not found for architecture armv7

in both cases i cant find this method anywhere (except bold declarations)
@felipejfc any advice? thanks for trying to keep this project up! wax is convinient indeed, it`s a pity it is dropped by probablycore //

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

@IPv6 I think you are not including all n-wax files in your project, check if you are including wax_ffi_closure .m and .h and also /lib/libffi files

from wax.

felipejfc avatar felipejfc commented on July 21, 2024

About the no_ffi branch you are probably not including wax_arguments .m and .h. In both cases you need to add files to your project, with the hacks i made for making it work i added new files into Wax. Note that I do not know which version is more performatic /stable. With or without libffi. Ild like your feedback

from wax.

caikelun avatar caikelun commented on July 21, 2024

@felipejfc Hi, I have just tested n-wax(the newest master branch: 89f3d35), the "states example" crash on iphone6 plus hardware device(Thread1: EXC_BAD_ACCESS (code=2, address=0x104aa8490)), but run OK on iphone6 plus simulator. Bug from libffi??

from wax.

qazaaa avatar qazaaa commented on July 21, 2024

@felipejfc Hi,would you please show me some details about how to compile wax_stdlib_64.h,thanks

from wax.

maxfong avatar maxfong commented on July 21, 2024

@qazaaa https://github.com/maxfong/wax_stdlib_x64

from wax.

intheway avatar intheway commented on July 21, 2024

wax is maintained by alibaba now, 64bit is support. see https://github.com/alibaba/wax

from wax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.