mirror of
https://github.com/samba-team/samba.git
synced 2024-12-31 17:18:04 +03:00
fixed size alignment in talloc
This commit is contained in:
parent
151b131ee0
commit
064cdb7ee6
@ -56,11 +56,11 @@ void *talloc(TALLOC_CTX *t, size_t size)
|
|||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
size = (size + TALLOC_ALIGN) & (~TALLOC_ALIGN-1);
|
size = (size + (TALLOC_ALIGN-1)) & ~(TALLOC_ALIGN-1);
|
||||||
|
|
||||||
if (!t->list || (t->list->total_size - t->list->alloc_size) < size) {
|
if (!t->list || (t->list->total_size - t->list->alloc_size) < size) {
|
||||||
struct talloc_chunk *c;
|
struct talloc_chunk *c;
|
||||||
size_t asize = (size + TALLOC_CHUNK_SIZE) & ~(TALLOC_CHUNK_SIZE-1);
|
size_t asize = (size + (TALLOC_CHUNK_SIZE-1)) & ~(TALLOC_CHUNK_SIZE-1);
|
||||||
|
|
||||||
c = (struct talloc_chunk *)malloc(sizeof(*c));
|
c = (struct talloc_chunk *)malloc(sizeof(*c));
|
||||||
if (!c) return NULL;
|
if (!c) return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user