EXC_ARM_DA_ALIGN崩溃(EXC_ARM_DA_ALIGN crash)
我的应用程序中出现EXC_ARM_DA_ALIGN崩溃。 这是Xcode标记为“恶性”的代码。 在模拟器上,我没有这个崩溃,只能在设备上,所以我认为这是一个内存对齐问题。 有没有人知道如何解决这个问题? 非常感谢。
-(int) Save:(void*) pBuf { int nNeedSize = sizeof(fType) + sizeof(sizeBrush) + sizeof(nBrushType) + sizeof(rcImage) + sizeof(count) + sizeof(data[0]) * count; if (pBuf == nil) return nNeedSize; *(NSInteger*)pBuf = count; pBuf += sizeof(count); *(BOOL*)pBuf = fType; pBuf += sizeof(fType); (*(CGSize*)pBuf).width = sizeBrush.width; (*(CGSize*)pBuf).height = sizeBrush.height; pBuf += sizeof(sizeBrush); *(NSInteger*)pBuf = nBrushType; pBuf += sizeof(nBrushType); (*(CGRect*)pBuf).size.width = rcImage.size.width; (*(CGRect*)pBuf).size.height = rcImage.size.height; (*(CGRect*)pBuf).origin.x = rcImage.origin.x; (*(CGRect*)pBuf).origin.y = rcImage.origin.y; pBuf += sizeof(rcImage); for (int i = 0; i < count; i++) { (*(CGPoint*)pBuf).x = data[i].x; (*(CGPoint*)pBuf).y = data[i].y; pBuf += sizeof(data[0]); } return nNeedSize;}
这是另一个被标记为恶性的部分:
int i; int nTotalSize = 0; for (i = 0; i < m_Data.count; i++) { maskStroke* one = [m_Data objectAtIndex:i]; nTotalSize += [one Save:NULL]; } unsigned char* buf = (unsigned char*)malloc(nTotalSize+100); unsigned char* cur_ptr = buf; for (i = 0; i < m_Data.count; i++) { maskStroke* one = [m_Data objectAtIndex:i]; cur_ptr += [one Save:cur_ptr]; }
I'm having a EXC_ARM_DA_ALIGN crash in my application. Here's the code that Xcode flag as "malignant". On the simulator I don't have this crash, only on device, so I think it is a memory alignment problem. Is there anyone who knows how to fix this code? Thank you so much.
-(int) Save:(void*) pBuf { int nNeedSize = sizeof(fType) + sizeof(sizeBrush) + sizeof(nBrushType) + sizeof(rcImage) + sizeof(count) + sizeof(data[0]) * count; if (pBuf == nil) return nNeedSize; *(NSInteger*)pBuf = count; pBuf += sizeof(count); *(BOOL*)pBuf = fType; pBuf += sizeof(fType); (*(CGSize*)pBuf).width = sizeBrush.width; (*(CGSize*)pBuf).height = sizeBrush.height; pBuf += sizeof(sizeBrush); *(NSInteger*)pBuf = nBrushType; pBuf += sizeof(nBrushType); (*(CGRect*)pBuf).size.width = rcImage.size.width; (*(CGRect*)pBuf).size.height = rcImage.size.height; (*(CGRect*)pBuf).origin.x = rcImage.origin.x; (*(CGRect*)pBuf).origin.y = rcImage.origin.y; pBuf += sizeof(rcImage); for (int i = 0; i < count; i++) { (*(CGPoint*)pBuf).x = data[i].x; (*(CGPoint*)pBuf).y = data[i].y; pBuf += sizeof(data[0]); } return nNeedSize;}
And here's another part flagged as malignant:
int i; int nTotalSize = 0; for (i = 0; i < m_Data.count; i++) { maskStroke* one = [m_Data objectAtIndex:i]; nTotalSize += [one Save:NULL]; } unsigned char* buf = (unsigned char*)malloc(nTotalSize+100); unsigned char* cur_ptr = buf; for (i = 0; i < m_Data.count; i++) { maskStroke* one = [m_Data objectAtIndex:i]; cur_ptr += [one Save:cur_ptr]; }
原文:https://stackoverflow.com/questions/15925287
更新时间:2023-07-10 20:07
最满意答案
此链接将帮助您修改注册表。
大多数用于所有文件和文件夹的菜单项都可以在以下其中一个键中找到:
HKEY_CLASSES_ROOT\*\shell HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers HKEY_CLASSES_ROOT\AllFileSystemObjects\ShellEx
This link will help you to modify registry.
Most of the menu items that used for all files and folders can be found at one of these keys:
HKEY_CLASSES_ROOT\*\shell HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers HKEY_CLASSES_ROOT\AllFileSystemObjects\ShellEx
相关问答
更多-
Ctrl + Shift + N将打开一个新窗口。 然后,您可以使用“文件”>“打开文件夹”在每个窗口中具有两个具有不同文件夹的Visual Studio代码实例。 Mac的⌘ + Shift + N 有用的键盘快捷键列表可以在这里找到 Ctrl + Shift + N will open a new window, while Ctrl+K then releases the keys, and pressing O would open the current tab in a new window. ...
-
如何从右键菜单中删除“用代码打开”(How do I remove 'open with code' from my context menu for Visual Studio Code?)[2023-05-02]
此链接将帮助您修改注册表。 大多数用于所有文件和文件夹的菜单项都可以在以下其中一个键中找到: HKEY_CLASSES_ROOT\*\shell HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers HKEY_CLASSES_ROOT\AllFileSystemObjects\ShellEx This link will help you to modify registry. Most of the menu items that used fo ... -
根据这篇博文,你可以在安装过程中设置这个选项。 如果您想在此后添加此选项,您可以按照其他帖子的说明或(按照建议)重新安装vscode,然后在重新安装期间选择该选项。 当我遇到同样的问题时,对我来说,重新安装vscode会更加舒适。 According to this blog post you can set this option during the installation process. If you want to add this option afterwards you either ca ...
-
您需要Visual Studio ULTIMATE才能创建代码映射。 http://msdn.microsoft.com/en-us/library/jj739835.aspx You need Visual Studio ULTIMATE to create Code Maps. http://msdn.microsoft.com/en-us/library/jj739835.aspx
-
添加\编辑\删除右键单击WPF TreeView代码背后的上下文菜单(Add\Edit\Remove Right Click Context Menu Of WPF TreeView Code Behind)[2021-08-05]
你为什么需要那个? 也许在不影响代码背后以其他方式做到更好? 我倾向于将View和逻辑解耦,基本上这是我建议遵循的MVVM方法。 无论如何,你可以通过添加Initialized事件处理程序来完成它,而不是将其交给代码: XAML:settings.json Ctrl + , "terminal.integrated.rightClickBehavior": false, settings.json Ctrl+, "terminal.integrated.rightClickBehavior": "default",我发现了一个小项目,可以满足您的需求: 完整的代码可以在这里下载。 下载并编译代码后,要在Windows资源管理器上下文菜单中添加“作为网站打开”选项,您需要运行下载中包含的.reg文件。 这会在运行该程序的HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Folder \ shell \中添加一个注册表项,并传入刚刚右键单击的路径文件夹。 在运行之前,您需要自定义此.reg文件,并输入程序的路径。 您还需要指定转储项目文件的路径。 我选择了文件夹C:\ Documents ...通常情况下,我只是删除代码,没有什么不好的。 更糟糕的是,当你尝试构建时,你会在designer.cs中遇到一个错误,说找不到一些代码。 只需删除它,一切都会正常工作。 双击时也可以使用Ctrl + Z,但它会删除双击的组件,您必须再次将其添加到表单中。 Normally, I simply delete the code and nothing bad come out of it. At worse, when you try to build, you'll get an error in the d ...尝试激活窗口(如果不起作用,请在窗口的标题栏上单击鼠标)。 然后使用!f打开文件菜单并通过发送字母键导航菜单。 Microsoft程序总是很难处理。 Try activating the window (if that doesn't work, make the mouse click on the title bar of the window). Then use !f to open the file menu and navigate the menu by sending letter keys ...你可以这样做: 打开首选项(或Windows上的文件 - >设置) 转到外观和行为 - >菜单和工具栏 打开编辑器弹出式菜单 点击此列表中您要添加重新格式化代码命令旁边的项目 单击“添加后”按钮 在选择操作对话框中,单击所有操作 - >主菜单 - >代码 - >重新格式化代码,然后单击确定。 单击确定以关闭首选项对话框,您应该在代码编辑器窗口上下文菜单中看到重新格式化代码。 这些说明适用于MacOS上的Android Studio 3,我知道它与Windows上的Android Studio 2.3.1上的 ...相关文章
更多- JVM crash. 请帮忙分析一些可能是什么原因
- 基于ARM的视频监控
- English,The Da Vinci Code,Chapter 1-3
- 顿时崩溃了。。。
- 《嵌入式linux视频教程/ARM视频教程/2440视频教程/6410视频教程》成都国嵌嵌入式培训中心的基于2440/6410开发板的视频教程[光盘镜像]
- cdh4b1之HDFS的HA(High Availability)原理简介
- Hahoop动态的添加DataNode和TaskTracker
- Hadoop 动态添加节点datanode及tasktracker
- android 模拟器崩溃?
- Android照片墙应用实现,再多的图片也不怕崩溃
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。