[pulseaudio-discuss] [PATCH 08/11] pulsecore: Standardize memory-types annotation using pa_mem_type_t
Tanu Kaskinen
tanuk at iki.fi
Sat Sep 26 02:39:45 PDT 2015
On Sun, 2015-09-20 at 23:35 +0200, Ahmed S. Darwish wrote:
> diff --git a/src/pulsecore/mem.h b/src/pulsecore/mem.h
> index e5a9ec3..e7a8182 100644
> --- a/src/pulsecore/mem.h
> +++ b/src/pulsecore/mem.h
> @@ -44,6 +44,12 @@ typedef struct pa_mem {
> __PA_PARENT_MEM_STRUCT__;
> } pa_mem;
>
> +typedef enum pa_mem_type {
> + PA_MEMORY_UNDEFINED = 0, /* NULL marker */
> + PA_MEMORY_SHARED_POSIX, /* Data is shared and created using POSIX shm_open() */
> + PA_MEMORY_SHARED_MEMFD, /* Data is shared and created using Linux memfd_create() */
> + PA_MEMORY_PRIVATE, /* Data is private and created using classic memory allocation (malloc, etc.) */
> +} pa_mem_type_t;
I think PA_MEM would be a better prefix than PA_MEMORY, since other
related identifiers use pa_mem as the prefix too. (I'd actually use
PA_MEM_TYPE as the prefix myself, since I think it's good to include
the enum type name fully in the value names, but that's just personal
taste, and there are many places where that rule isn't followed.)
--
Tanu
More information about the pulseaudio-discuss
mailing list