home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 488.lha / TCL_alpha2 / tcl.lzh / tcl / docs / tcla / ickalloc.doc < prev    next >
Encoding:
Text File  |  1990-05-04  |  1.1 KB  |  43 lines

  1.  
  2.  
  3. ickalloc - Intertask Failure-Checking Malloc
  4.  
  5.  
  6. We are fairly clever about memory allocation for intertask messages.
  7.  
  8. We hardly have to do anything tricky to do this, but we have the one
  9. tricky thing that text replies in reply messages are allocated by
  10. the guy doing the reply but deleted by the guy receiving it.
  11.  
  12. Thus, this needs to not use the normal ckalloc and ckfree, because
  13. when a task exits, all the memory it allocated with ckalloc is freed,
  14. and that can include memory owned by the other task.
  15.  
  16. Anyway, if you look in ports.c you will see where intertask_ckalloc
  17. and intertask_ckfree are called.
  18.  
  19. Note: Manx alloc and free are brain-damaged and need to be replaced.
  20. They can incur a lot of overhead.  Also, versions probably need to
  21. be created that bitch when you free something you didn't allocate.
  22. As it is now, the Manx lib routines just blow off the request.
  23.  
  24.  
  25. #define MEMORY_MAGIC 0xcadbabe
  26.  
  27. #include <functions.h>
  28. #include <exec/memory.h>
  29.  
  30. struct mementry {
  31.     long length;
  32.     long memory_magic;
  33. };
  34.  
  35. void *intertask_ckalloc(size_t length)
  36. {
  37. }
  38.  
  39. void intertask_ckfree(void *where)
  40. {
  41. }
  42.  
  43.