emacs-devel
[Top][All Lists]
Advanced

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

Re: Menus and w32 memory management


From: Eli Zaretskii
Subject: Re: Menus and w32 memory management
Date: Mon, 02 Jun 2014 19:07:05 +0300

> Date: Mon, 02 Jun 2014 18:21:26 +0400
> From: Dmitry Antipov <address@hidden>
> CC: Eli Zaretskii <address@hidden>
> 
> Looking through src/w32gui.h, I found the following fragment:
> 
> /* Local memory management for menus.  */
> #define local_heap (GetProcessHeap ())
> #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n)))
> #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p))))
> 
> #define malloc_widget_value() ((widget_value *) local_alloc (sizeof 
> (widget_value)))
> #define free_widget_value(wv) (local_free ((wv)))

This code is very old.  We've been using separate allocation APIs
there since almost day one.  I have no idea why (and know very little
about it anyway).

> Why we can't use generic xzalloc and xfree here?

I guess (on the trunk, malloc is redirected to call HeapAlloc anyway),
except that they block input, something the code which calls these
local_* macros already does.



reply via email to

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