1
0

partition_sysalloc.c 543 B

123456789101112131415161718192021222324
  1. /*
  2. * partition_sysalloc.c
  3. */
  4. #include <stdlib.h>
  5. #include "private.h"
  6. /*-------------------------------------------------------- */
  7. void *
  8. lub_partition_sysalloc(lub_partition_t *this,
  9. size_t required)
  10. {
  11. void *result = 0;
  12. if(required < this->m_partition_ceiling)
  13. {
  14. result = this->m_spec.sysalloc(required);
  15. if(result)
  16. {
  17. this->m_partition_ceiling -= required;
  18. }
  19. }
  20. return result;
  21. }
  22. /*-------------------------------------------------------- */