[Top][All Lists]

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

Re: Can we go GTK-only?

From: Eli Zaretskii
Subject: Re: Can we go GTK-only?
Date: Thu, 03 Nov 2016 19:40:30 +0200

> Date: Thu, 03 Nov 2016 12:43:18 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> Cc: address@hidden,
>       address@hidden,
>       address@hidden,
>       address@hidden,
>       address@hidden
> > I know next to nothing about NS.  These are system APIs, right?  If
> > so, calling them could be okay, and I defer to NS and OS X people here
> > to make that call.
> They internally use malloc/free.  What if the code like above were
> using malloc/free instead of CF functions?
> BTW, I just remember the current implementation of xfree should not be
> used from a non-main thread if XMALLOC_BLOCK_INPUT_CHECK is defined.
> The Mac port contains a code that calls "free" off the main thread for
> some data that were allocated in the main thread.

Yes, xmalloc/xfree should only be called from the main thread.  The
problem with calling malloc directly in Emacs is that you need to deal
with failures, which is not trivial in Emacs, whereas xmalloc and
friends has all that figured out already.

> For CFDictionary itself, its fundamental operations are thread-safe,
> as well as malloc/free.  For the font data structure that use
> CFDictionary, the main thread waits for the other thread after doing
> some independent tasks that do not use CFDictionary.

Then I guess this is okay.


reply via email to

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