compat.c 266 B

123456789101112131415161718192021222324252627282930
  1. #include "cc.h"
  2. #include "compat"
  3. /*
  4. * fake mallocs
  5. */
  6. void*
  7. malloc(ulong n)
  8. {
  9. return alloc(n);
  10. }
  11. void*
  12. calloc(ulong m, ulong n)
  13. {
  14. return alloc(m*n);
  15. }
  16. void*
  17. realloc(void*, ulong)
  18. {
  19. fprint(2, "realloc called\n");
  20. abort();
  21. return 0;
  22. }
  23. void
  24. free(void*)
  25. {
  26. }