ua_architecture_base.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. *
  5. * Copyright 2018 (c) Stefan Profanter, fortiss GmbH
  6. */
  7. #ifndef ARCH_UA_ARCHITECTURE_BASE_H
  8. #define ARCH_UA_ARCHITECTURE_BASE_H
  9. /*
  10. * With the following list of defines, one can define its own UA_sleep_ms using a preprocessor define.
  11. * E.g. see unit tests.
  12. */
  13. #ifdef UA_sleep_ms
  14. void UA_sleep_ms(unsigned long ms);
  15. #endif
  16. #ifdef UA_malloc
  17. void* UA_malloc(unsigned long size);
  18. #endif
  19. #ifdef UA_calloc
  20. void* UA_calloc(unsigned long num, unsigned long size); //allocate memory in the heap with size*num bytes and set the memory to zero
  21. #endif
  22. #ifdef UA_realloc
  23. void* UA_realloc(void *ptr, unsigned long new_size);//re-allocate memory in the heap with new_size bytes from previously allocated memory ptr
  24. #endif
  25. #ifdef UA_free
  26. void UA_free(void* ptr); //de-allocate memory previously allocated with UA_malloc, UA_calloc or UA_realloc
  27. #endif
  28. #endif //ARCH_UA_ARCHITECTURE_BASE_H