New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -43,10 +43,10 @@ static void *a_malloc(size_t size)
|
|||
void *ptr = NULL;
|
||||
long diff;
|
||||
|
||||
ptr = malloc(size + ALIGNMENT);
|
||||
ptr = malloc(size + ALIGNMENT);
|
||||
if (ptr) {
|
||||
diff = ((~(long)ptr) & (ALIGNMENT - 1)) + 1;
|
||||
ptr = (char *)ptr + diff;
|
||||
ptr = (char *)ptr + diff;
|
||||
((char *)ptr)[-1] = (char)diff;
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ static void *a_realloc(void *ptr, size_t size)
|
|||
if (!ptr)
|
||||
return a_malloc(size);
|
||||
diff = ((char *)ptr)[-1];
|
||||
ptr = realloc((char*)ptr - diff, size + diff);
|
||||
ptr = realloc((char *)ptr - diff, size + diff);
|
||||
if (ptr)
|
||||
ptr = (char *)ptr + diff;
|
||||
return ptr;
|
||||
|
|
@ -81,7 +81,7 @@ static void a_free(void *ptr)
|
|||
_aligned_free(ptr);
|
||||
#elif ALIGNMENT_HACK
|
||||
if (ptr)
|
||||
free((char *)ptr - ((char*)ptr)[-1]);
|
||||
free((char *)ptr - ((char *)ptr)[-1]);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
|
|
@ -103,7 +103,7 @@ void *bmalloc(size_t size)
|
|||
if (!ptr) {
|
||||
os_breakpoint();
|
||||
bcrash("Out of memory while trying to allocate %lu bytes",
|
||||
(unsigned long)size);
|
||||
(unsigned long)size);
|
||||
}
|
||||
|
||||
os_atomic_inc_long(&num_allocs);
|
||||
|
|
@ -121,7 +121,7 @@ void *brealloc(void *ptr, size_t size)
|
|||
if (!ptr) {
|
||||
os_breakpoint();
|
||||
bcrash("Out of memory while trying to allocate %lu bytes",
|
||||
(unsigned long)size);
|
||||
(unsigned long)size);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue