1
0

partition_segment_alloc.c 526 B

12345678910111213141516171819
  1. /*
  2. * partition_segment_alloc.c
  3. */
  4. #include "private.h"
  5. /*-------------------------------------------------------- */
  6. void *
  7. lub_partition_segment_alloc(lub_partition_t *this,
  8. size_t *required)
  9. {
  10. if(*required < this->m_spec.min_segment_size)
  11. {
  12. *required = (this->m_spec.min_segment_size >> 1);
  13. }
  14. /* double the required size */
  15. *required <<= 1;
  16. return lub_partition_sysalloc(this,*required);
  17. }
  18. /*-------------------------------------------------------- */