23 #if !defined(NO_MALLOC_DEBUG) && !defined(STANDALONE) && !defined(STANDALONE2) && defined(MALLOC_DEBUG)
33 #define AST_DIR_MODE 0777
36 #define AST_FILE_MODE 0666
39 #define DEFAULT_LANGUAGE "en"
41 #define DEFAULT_SAMPLE_RATE 8000
42 #define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
43 #define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__
44 #define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
46 #if defined(DEBUG_FD_LEAKS) && !defined(STANDALONE) && !defined(STANDALONE2) && !defined(STANDALONE_AEL)
49 #include <sys/types.h>
51 #include <sys/socket.h>
54 #define open(a,...) __ast_fdleak_open(__FILE__,__LINE__,__PRETTY_FUNCTION__, a, __VA_ARGS__)
55 #define pipe(a) __ast_fdleak_pipe(a, __FILE__,__LINE__,__PRETTY_FUNCTION__)
56 #define socket(a,b,c) __ast_fdleak_socket(a, b, c, __FILE__,__LINE__,__PRETTY_FUNCTION__)
57 #define close(a) __ast_fdleak_close(a)
58 #define fopen(a,b) __ast_fdleak_fopen(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__)
59 #define fclose(a) __ast_fdleak_fclose(a)
60 #define dup2(a,b) __ast_fdleak_dup2(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__)
61 #define dup(a) __ast_fdleak_dup(a, __FILE__,__LINE__,__PRETTY_FUNCTION__)
63 #if defined(__cplusplus) || defined(c_plusplus)
66 int __ast_fdleak_open(
const char *file,
int line,
const char *func,
const char *path,
int flags, ...);
67 int __ast_fdleak_pipe(
int *fds,
const char *file,
int line,
const char *func);
68 int __ast_fdleak_socket(
int domain,
int type,
int protocol,
const char *file,
int line,
const char *func);
69 int __ast_fdleak_close(
int fd);
70 FILE *__ast_fdleak_fopen(
const char *path,
const char *mode,
const char *file,
int line,
const char *func);
71 int __ast_fdleak_fclose(FILE *ptr);
72 int __ast_fdleak_dup2(
int oldfd,
int newfd,
const char *file,
int line,
const char *func);
73 int __ast_fdleak_dup(
int oldfd,
const char *file,
int line,
const char *func);
74 #if defined(__cplusplus) || defined(c_plusplus)
114 #if !defined(LOW_MEMORY)
167 #define HAVE_MTX_PROFILE
168 #define ASTERISK_FILE_VERSION(file, version) \
169 static int mtx_prof = -1; \
170 static void __attribute__((constructor)) __register_file_version(void) \
172 mtx_prof = ast_add_profile("mtx_lock_" file, 0); \
173 ast_register_file_version(file, version); \
175 static void __attribute__((destructor)) __unregister_file_version(void) \
177 ast_unregister_file_version(file); \
180 #define ASTERISK_FILE_VERSION(file, version) \
181 static void __attribute__((constructor)) __register_file_version(void) \
183 ast_register_file_version(file, version); \
185 static void __attribute__((destructor)) __unregister_file_version(void) \
187 ast_unregister_file_version(file); \
191 #define ASTERISK_FILE_VERSION(file, x)
194 #if !defined(LOW_MEMORY)
212 int64_t
ast_mark(
int,
int start1_stop0);
214 #define ast_add_profile(a, b) 0
215 #define ast_profile(a, b) do { } while (0)
216 #define ast_mark(a, b) do { } while (0)
239 #define bzero 0x__dont_use_bzero__use_memset_instead""
240 #define bcopy 0x__dont_use_bcopy__use_memmove_instead()
Asterisk memory usage debugging This file provides headers for MALLOC_DEBUG, a define used for tracki...
int64_t ast_mark(int, int start1_stop0)
Main Channel structure associated with a channel.
int64_t ast_profile(int, int64_t)
void ast_register_file_version(const char *file, const char *version)
Register the version of a source code file with the core.
char * ast_complete_source_filename(const char *partial, int n)
Structure for variables, used for configurations and for channel variables.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
void ast_unregister_atexit(void(*func)(void))
Unregister a function registered with ast_register_atexit().
int ast_register_atexit(void(*func)(void))
Register a function to be executed before Asterisk exits.
int ast_set_priority(int)
We set ourselves to a high priority, that we might pre-empt everything else. If your PBX has heavy ac...
int ast_add_profile(const char *, uint64_t scale)
support for event profiling
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
General Definitions for Asterisk top level program Included by asterisk.h to handle platform-specific...
Data structure associated with a single frame of data.
const char * ast_file_version_find(const char *file)
Find version for given module name.
void ast_unregister_file_version(const char *file)
Unregister a source code file from the core.