mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
Make sure we initialize object hash.
This patch also move the hash implementation details to wayland-util.c.
This commit is contained in:
parent
997e71eb1e
commit
864c468b42
3 changed files with 42 additions and 11 deletions
|
|
@ -21,8 +21,34 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "wayland.h"
|
||||
|
||||
struct wl_hash {
|
||||
struct wl_object **objects;
|
||||
uint32_t count, alloc;
|
||||
};
|
||||
|
||||
struct wl_hash *
|
||||
wl_hash_create(void)
|
||||
{
|
||||
struct wl_hash *hash;
|
||||
|
||||
hash = malloc(sizeof *hash);
|
||||
if (hash == NULL)
|
||||
return hash;
|
||||
|
||||
memset(hash, 0, sizeof *hash);
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
void
|
||||
wl_hash_destroy(struct wl_hash *hash)
|
||||
{
|
||||
free(hash);
|
||||
}
|
||||
|
||||
int wl_hash_insert(struct wl_hash *hash, struct wl_object *object)
|
||||
{
|
||||
struct wl_object **objects;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue