SystemMemory.h 457 B

123456789101112131415161718192021222324
  1. #ifndef _SYTEM_MEMORY_H
  2. #define _SYTEM_MEMORY_H
  3. #include <mqx.h>
  4. #include <bsp.h>
  5. #include <stdlib.h>
  6. #define test_object(object) if(object == NULL)return NULL
  7. #define new_string(str) (char*)malloc(strlen(str)+1)
  8. #define new_object(object) (object*)malloc(sizeof(object))
  9. #define reset_object(object,p) memset((void*)p,NULL,sizeof(object))
  10. extern void *new_byte(int size);
  11. extern void test_memory(void);
  12. #endif