1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

fixed size alignment in talloc

(This used to be commit 064cdb7ee69bff3af12d1e0b3c3b59207c594681)
This commit is contained in:
Andrew Tridgell 2000-06-26 08:18:42 +00:00
parent ec1c58fcc0
commit bdb98d93f2

View File

@ -56,11 +56,11 @@ void *talloc(TALLOC_CTX *t, size_t size)
{
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) {
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));
if (!c) return NULL;