Monado OpenXR Runtime
oxr_handle_base.c File Reference

Implementation. More...

#include "oxr_handle.h"
#include "util/u_debug.h"
#include "util/u_misc.h"
#include "oxr_objects.h"
#include "oxr_logger.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for oxr_handle_base.c:

Macros

#define HANDLE_LIFECYCLE_LOG(log, ...)
 
#define HANDLE_LIFECYCLE_LOG_SCOPED_BEGIN(log)
 
#define HANDLE_LIFECYCLE_LOG_SCOPED_END
 
#define HANDLE_LIFECYCLE_LOG_SCOPED(log, ...)
 

Functions

const char * oxr_handle_state_to_string (enum oxr_handle_state state)
 
XrResult oxr_handle_init (struct oxr_logger *log, struct oxr_handle_base *hb, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent)
 
XrResult oxr_handle_allocate_and_init (struct oxr_logger *log, size_t size, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent, void **out)
 
static XrResult oxr_handle_do_destroy (struct oxr_logger *log, struct oxr_handle_base *hb, int level)
 This is the actual recursive call that destroys handles. More...
 
XrResult oxr_handle_destroy (struct oxr_logger *log, struct oxr_handle_base *hb)
 

Detailed Description

Macro Definition Documentation

◆ HANDLE_LIFECYCLE_LOG

#define HANDLE_LIFECYCLE_LOG (   log,
  ... 
)
Value:
if (log->inst != NULL && log->inst->lifecycle_verbose) { \
oxr_log(log, " Handle Lifecycle: " __VA_ARGS__); \
}

◆ HANDLE_LIFECYCLE_LOG_SCOPED

#define HANDLE_LIFECYCLE_LOG_SCOPED (   log,
  ... 
)
Value:
if (_log_lifecycle_verbose) { \
oxr_log(log, " Handle Lifecycle: " __VA_ARGS__); \
}

◆ HANDLE_LIFECYCLE_LOG_SCOPED_BEGIN

#define HANDLE_LIFECYCLE_LOG_SCOPED_BEGIN (   log)
Value:
{ \
const bool _log_lifecycle_verbose = log->inst != NULL && log->inst->lifecycle_verbose;

◆ HANDLE_LIFECYCLE_LOG_SCOPED_END

#define HANDLE_LIFECYCLE_LOG_SCOPED_END
Value:
} \
(void)0

Function Documentation

◆ oxr_handle_do_destroy()

static XrResult oxr_handle_do_destroy ( struct oxr_logger log,
struct oxr_handle_base hb,
int  level 
)
static

This is the actual recursive call that destroys handles.

oxr_handle_destroy wraps this to provide some extra output and start level at 0. level, which is reported in debug output, is the current depth of recursion.