mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Change WL_ZOMBIE_OBJECT from 0x2 to an actual pointer
In order to use the second-lowest bit of each pointer in wl_map for the WL_MAP_ENTRY_LEGACY flag, every pointer has to be a multiple of 4. This was a good assumption, except with WL_ZOMBIE_OBJECT. This commit creates an actual static variable to which WL_ZOMBIE_OBJECT now points. Since things are only every compared to WL_ZOMBIE_OBJECT with "==" or "!=", the only thing that matters is that it is unique. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
		
							parent
							
								
									a3870a297c
								
							
						
					
					
						commit
						8fd60c683a
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -34,13 +34,14 @@
 | 
				
			||||||
	const __typeof__( ((type *)0)->member ) *__mptr = (ptr);	\
 | 
						const __typeof__( ((type *)0)->member ) *__mptr = (ptr);	\
 | 
				
			||||||
	(type *)( (char *)__mptr - offsetof(type,member) );})
 | 
						(type *)( (char *)__mptr - offsetof(type,member) );})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define WL_ZOMBIE_OBJECT ((void *) 2)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define WL_MAP_SERVER_SIDE 0
 | 
					#define WL_MAP_SERVER_SIDE 0
 | 
				
			||||||
#define WL_MAP_CLIENT_SIDE 1
 | 
					#define WL_MAP_CLIENT_SIDE 1
 | 
				
			||||||
#define WL_SERVER_ID_START 0xff000000
 | 
					#define WL_SERVER_ID_START 0xff000000
 | 
				
			||||||
#define WL_CLOSURE_MAX_ARGS 20
 | 
					#define WL_CLOSURE_MAX_ARGS 20
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern struct wl_object global_zombie_object;
 | 
				
			||||||
 | 
					#define WL_ZOMBIE_OBJECT ((void*)&global_zombie_object)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Flags for wl_map_insert_new and wl_map_insert_at.  Flags can be queried with
 | 
					/* Flags for wl_map_insert_new and wl_map_insert_at.  Flags can be queried with
 | 
				
			||||||
 * wl_map_lookup_flags.  The current implementation has room for 1 bit worth of
 | 
					 * wl_map_lookup_flags.  The current implementation has room for 1 bit worth of
 | 
				
			||||||
 * flags.  If more flags are ever added, the implementation of wl_map will have
 | 
					 * flags.  If more flags are ever added, the implementation of wl_map will have
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,6 +29,8 @@
 | 
				
			||||||
#include "wayland-util.h"
 | 
					#include "wayland-util.h"
 | 
				
			||||||
#include "wayland-private.h"
 | 
					#include "wayland-private.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct wl_object global_zombie_object;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WL_EXPORT void
 | 
					WL_EXPORT void
 | 
				
			||||||
wl_list_init(struct wl_list *list)
 | 
					wl_list_init(struct wl_list *list)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue