gopep9

Results 6 comments of gopep9

本来就有泄露吧,要新增一个block类型也很难知道这个block什么时候释放,感觉可以用一个全局的Dictionary来保存这堆新增出来的签名,起码相同类型的block不会再产生多个签名字符串。不过也有可能系统会自己释放这个内存?

callSelector中应该改成这样 ``` if(superClassName) _currInvokeSuperClsName[[NSString stringWithFormat:@"_JPSUPER_%@", selectorName]] = superClassName; [invocation invoke]; if(superClassName) [_currInvokeSuperClsName removeObjectForKey:[NSString stringWithFormat:@"_JPSUPER_%@", selectorName]]; ``` 原来的代码对于_currInvokeSuperClsName中存放的键值规划有点混乱,应该统一为"_JPSUPER_funcname" JPForwardInvocation函数中的 `_currInvokeSuperClsName[selectorName]` 也应该改为 `_currInvokeSuperClsName[JPSelectorName]`

在genCallbackBlock中 void (^block)(void) = ^(void){}; uint8_t *p = (uint8_t *)((__bridge void *)block); p += sizeof(void *) + sizeof(int32_t) *2; void(**invoke)(void) = (void (**)(void))p; p += sizeof(void *) + sizeof(uintptr_t) *...

这里正确的写法是 p += sizeof(void *) + sizeof(int32_t) *2; void(**invoke)(void) = (void (**)(void))p; p += sizeof(void*); void *p2 = *(void **)p; p = p2; p += sizeof(uintptr_t) * 2; const char...

I find a way to do this by string concatenation,just like this ``` total_str = "" local file = io.open("a.lua","r") a_str = file:read("*a") file:close() total_str = total_str..a_str file = io.open("b.lua","r")...

我也没试过提审,估计悬