emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Volunteering to help on etc/TODO item: Improved xwidgets support


From: Andrew De Angelis
Subject: Re: Volunteering to help on etc/TODO item: Improved xwidgets support
Date: Fri, 21 Oct 2022 19:29:52 -0400

Thanks Daniel! That's very helpful. I was looking at documentation online regarding profiling Emacs, but most of it is GNU/Linux focused so they'd all mention gprof, which to my understanding doesn't work on Mac. 
I'll work on using the Instruments.app, that should be very helpful in finding the leaks.

On Thu, Oct 20, 2022 at 7:13 AM Daniel Martín <mardani29@yahoo.es> wrote:
Andrew De Angelis <bobodeangelis@gmail.com> writes:

> Great, thanks Qiantian for the info.
> I'm looking into ways to adapt the Objective C code to use manual reference
> counting rather than ARC. Is this a problem that other Objective-C Emacs
> files have? Maybe I can also come up with some general rules/approaches to
> help people fix the problem in other files.
> One thing that would be very helpful is if you (or anyone else) is aware of
> somebody making this fix (ARC -> MRC in Objective C) before: most of the
> tutorials/documentation I'm finding on the topic is on how to go in the
> opposite direction, which is helpful information but I'm stuck "reverse
> engineering" the whole approach.
>

I'd also suggest instrumenting Emacs with Instruments.app and the
"Leaks" profile.  The generated profile will indicate if there are
retain/release/autorelease problems that led to leaked objects under
the MRC model.

In recent versions of macOS you might have problems running Emacs under
Instruments.app.  One way to resolve this problem is by embedding a
custom entitlement that sets "com.apple.security.get-task-allow" and
then signing the binary again.  That is, run this command from a shell:

$ codesign -s - -v -f --entitlements Entitlements.plist emacs

In the command above, "emacs" is the built Emacs binary and
Entitlements.plist should contain this text:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.get-task-allow
    </key>
    <true/>
  </dict>
</plist>

I suspect this tweak could perfectly be part of the Emacs build system
for NS, but I haven't investigated further.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]