initialize_allocator.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright 2011 Institute of Communication and Computer Systems (ICCS)
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. /**
  18. * \file initialize_allocator.h
  19. * \author Ioannis Koutras (joko@microlab.ntua.gr)
  20. * \date September, 2011
  21. * \brief dmmlib allocator initializator.
  22. */
  23. #ifndef INITIALIZE_ALLOCATOR_H
  24. #define INITIALIZE_ALLOCATOR_H
  25. #include <dmmlib/heap.h>
  26. #include "dmm_config.h"
  27. #ifdef NO_SYSTEM_CALLS
  28. /**
  29. * Initialize an allocator. Since no system calls can be made, the developer
  30. * has to define explicitly the memory space the allocator will manage.
  31. *
  32. * \param allocator The address of the allocator.
  33. * \param starting_address The starting addres of the memory space which the
  34. * allocator has to handle.
  35. * \param size The total size of the memory space which the allocator has to
  36. * handle.
  37. */
  38. void initialize_allocator(allocator_t *allocator, void *starting_address,
  39. size_t size);
  40. #else /* NO_SYSTEM_CALLS */
  41. /**
  42. * Initialize an allocator.
  43. *
  44. * \param allocator The address of the allocator.
  45. */
  46. void initialize_allocator(allocator_t *allocator);
  47. #endif /* NO_SYSTEM_CALLS */
  48. #endif /* INITIALIZE_ALLOCATOR_H */