Changeset View
Changeset View
Standalone View
Standalone View
src/secmem.c
Context not available. | |||||
/* Initialize first memory block. */ | /* Initialize first memory block. */ | ||||
mb = (memblock_t *) pool->mem; | mb = (memblock_t *) pool->mem; | ||||
mb->size = pool->size; | mb->size = pool->size - BLOCK_HEAD_SIZE; | ||||
mb->flags = 0; | mb->flags = 0; | ||||
} | } | ||||
Context not available. | |||||
mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | ||||
if (mb) | if (mb) | ||||
{ | { | ||||
stats_update (pool, size, 0); | stats_update (pool, mb->size, 0); | ||||
return &mb->aligned.c; | return &mb->aligned.c; | ||||
} | } | ||||
Context not available. | |||||
mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | ||||
if (mb) | if (mb) | ||||
{ | { | ||||
stats_update (pool, size, 0); | stats_update (pool, mb->size, 0); | ||||
return &mb->aligned.c; | return &mb->aligned.c; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
return NULL; /* Not enough memory available for a new pool. */ | return NULL; /* Not enough memory available for a new pool. */ | ||||
/* Initialize first memory block. */ | /* Initialize first memory block. */ | ||||
mb = (memblock_t *) pool->mem; | mb = (memblock_t *) pool->mem; | ||||
mb->size = pool->size; | mb->size = pool->size - BLOCK_HEAD_SIZE; | ||||
mb->flags = 0; | mb->flags = 0; | ||||
pool->okay = 1; | pool->okay = 1; | ||||
Context not available. | |||||
mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | mb = mb_get_new (pool, (memblock_t *) pool->mem, size); | ||||
if (mb) | if (mb) | ||||
{ | { | ||||
stats_update (pool, size, 0); | stats_update (pool, mb->size, 0); | ||||
return &mb->aligned.c; | return &mb->aligned.c; | ||||
} | } | ||||
} | } | ||||
Context not available. |