core: Remove ABI effects of LOW_MEMORY.

This allows asterisk to compiled with LOW_MEMORY to load modules built
without LOW_MEMORY.

ASTERISK-26398 #close

Change-Id: I24b78ac9493ab933b11087a8b6794f3c96d4872d
This commit is contained in:
Corey Farrell
2016-09-19 05:46:27 -04:00
parent 2d2a8944be
commit 8c5c95ad89
13 changed files with 85 additions and 71 deletions

View File

@@ -32,10 +32,8 @@ ASTERISK_REGISTER_FILE()
int option_debug = 0;
int option_verbose = 0;
#if !defined(LOW_MEMORY)
void __ast_register_file(const char *file) { }
void __ast_unregister_file(const char *file) { }
#endif
/*** MODULEINFO
<depend>res_ael_share</depend>
@@ -180,7 +178,6 @@ struct ast_custom_function *ast_custom_function_find(const char *name)
return 0; /* in "standalone" mode, functions are just not avail */
}
#if !defined(LOW_MEMORY)
int ast_add_profile(const char *x, uint64_t scale)
{
if (!no_comp)
@@ -188,7 +185,6 @@ int ast_add_profile(const char *x, uint64_t scale)
return 0;
}
#endif
int ast_loader_register(int (*updater)(void))
{
@@ -606,7 +602,6 @@ unsigned int ast_hashtab_hash_contexts(const void *obj)
}
#ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY)
void ast_mark_lock_acquired(void *lock_addr)
{
}
@@ -652,5 +647,4 @@ void ast_suspend_lock_info(void *lock_addr)
void ast_restore_lock_info(void *lock_addr)
{
}
#endif /* !defined(LOW_MEMORY) */
#endif /* DEBUG_THREADS */

View File

@@ -98,7 +98,6 @@ void __ast_unregister_file(const char *file)
{
}
#if !defined(LOW_MEMORY)
int ast_add_profile(const char *, uint64_t scale);
int ast_add_profile(const char *s, uint64_t scale)
{
@@ -115,7 +114,6 @@ int64_t ast_mark(int key, int start1_stop0)
{
return 0;
}
#endif /* LOW_MEMORY */
/* end of dummy functions */

View File

@@ -56,7 +56,6 @@ void * attribute_malloc __ast_calloc(size_t num, size_t len, const char *file, i
#endif
#ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY)
#ifdef HAVE_BKTR
void ast_store_lock_info(enum ast_lock_type type, const char *filename,
int line_num, const char *func, const char *lock_name, void *lock_addr, struct ast_bt *bt);
@@ -117,7 +116,6 @@ void ast_mark_lock_acquired(void *foo)
{
/* not a lot to do in a standalone w/o threading! */
}
#endif
#endif /* DEBUG_THREADS */
@@ -161,9 +159,7 @@ void parse_file(const char *fname);
void __ast_register_file(const char *file);
void __ast_register_file(const char *file) { }
#if !defined(LOW_MEMORY)
int ast_add_profile(const char *x, uint64_t scale) { return 0;}
#endif
int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
{
int ret;

View File

@@ -88,9 +88,7 @@ void __ast_unregister_file(const char *file);
void __ast_unregister_file(const char *file)
{
}
#if !defined(LOW_MEMORY)
int ast_add_profile(const char *x, uint64_t scale) { return 0;}
#endif
/* Our own version of ast_log, since the expr parser uses it. -- stolen from utils/check_expr.c */
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__((format(printf,5,6)));
@@ -708,7 +706,6 @@ unsigned int ast_hashtab_hash_contexts(const void *obj)
}
#ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY)
void ast_mark_lock_acquired(void *lock_addr)
{
}
@@ -755,5 +752,4 @@ void ast_suspend_lock_info(void *lock_addr)
void ast_restore_lock_info(void *lock_addr)
{
}
#endif /* !defined(LOW_MEMORY) */
#endif /* DEBUG_THREADS */