Merge "core: Backport compatible MALLOC_DEBUG changes." into 13

certified/13.21
Jenkins2 7 years ago committed by Gerrit Code Review
commit 94b72ace2f

@ -78,11 +78,9 @@
<support_level>extended</support_level>
</member>
<member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations">
<conflict>DEBUG_CHAOS</conflict>
<support_level>core</support_level>
</member>
<member name="DEBUG_CHAOS" displayname="Randomly FAIL memory allocations or other operations">
<conflict>MALLOC_DEBUG</conflict>
<support_level>core</support_level>
</member>
<member name="ADDRESS_SANITIZER" displayname="Address Sanitizer">

@ -227,6 +227,8 @@ static void *__ast_alloc_region(size_t size, const enum func_type which, const c
unsigned int *fence;
int hash;
DEBUG_CHAOS_RETURN(DEBUG_CHAOS_ALLOC_CHANCE, NULL);
if (!(reg = malloc(size + sizeof(*reg) + sizeof(*fence)))) {
astmm_log("Memory Allocation Failure - '%d' bytes at %s %s() line %d\n",
(int) size, file, func, lineno);
@ -664,7 +666,6 @@ int __ast_vasprintf(char **strp, const char *fmt, va_list ap, const char *file,
size = vsnprintf(&s, 1, fmt, ap2);
va_end(ap2);
if (!(*strp = __ast_alloc_region(size + 1, FUNC_VASPRINTF, file, lineno, func, 0))) {
va_end(ap);
return -1;
}
vsnprintf(*strp, size + 1, fmt, ap);

1
utils/.gitignore vendored

@ -3,6 +3,7 @@ aelparse
aelparse.c
ast_expr2.c
ast_expr2f.c
astmm.c
astman
astcanary
astdb2bdb

Loading…
Cancel
Save