diff options
Diffstat (limited to 'fitz/fitz-internal.h')
-rw-r--r-- | fitz/fitz-internal.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index efc08a41..04ce19e5 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -15,6 +15,9 @@ fz_context *fz_clone_context_internal(fz_context *ctx); void fz_new_aa_context(fz_context *ctx); void fz_free_aa_context(fz_context *ctx); +/* Default locks */ +extern fz_locks_context fz_locks_default; + #if defined(MEMENTO) || defined(DEBUG) #define FITZ_DEBUG_LOCKING #endif @@ -54,6 +57,22 @@ fz_unlock(fz_context *ctx, int lock) * Basic runtime and utility functions */ +/* + fz_malloc_struct: Allocate storage for a structure (with scavenging), + clear it, and (in Memento builds) tag the pointer as belonging to a + struct of this type. + + CTX: The context. + + STRUCT: The structure type. + + Returns a pointer to allocated (and cleared) structure. Throws + exception on failure to allocate. +*/ +/* alloc and zero a struct, and tag it for memento */ +#define fz_malloc_struct(CTX, STRUCT) \ + Memento_label(fz_calloc(CTX,1,sizeof(STRUCT)), #STRUCT) + /* Range checking atof */ float fz_atof(const char *s); |