Commit ca4a4456 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

LDAP_THREAD_DEBUG revamping, cleanup, bug fixes.

Expand usage struct with magic numbers and state info.
Add options "noreinit", "nosync", "nomem", "threadID".  Remove "dupinit".
Detect address changes.  Turn off thread ID tracking by default.
parent 3462baf8
......@@ -247,9 +247,25 @@ LDAP_BEGIN_DECL
#define LDAP_UINTPTR_T unsigned long
typedef union {
unsigned char *ptr;
typedef enum {
ldap_debug_magic = -(int) (((unsigned)-1)/19)
} ldap_debug_magic_t;
typedef enum {
/* Could fill in "locked" etc here later */
ldap_debug_state_inited = (int) (((unsigned)-1)/11),
} ldap_debug_state_t;
typedef struct {
/* Enclosed in magic numbers in the hope of catching overwrites */
ldap_debug_magic_t magic; /* bit pattern to recognize usages */
LDAP_UINTPTR_T self; /* ~(LDAP_UINTPTR_T)&(this struct) */
union ldap_debug_mem_u { /* Dummy memory reference */
unsigned char *ptr;
} mem;
ldap_debug_state_t state; /* doubles as another magic number */
} ldap_debug_usage_info_t;
typedef struct {
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment