Changeset 3140 for trunk/src/kmk/alloccache.c
- Timestamp:
- Mar 14, 2018, 10:28:10 PM (7 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
-
Property svn:mergeinfo
set to
/vendor/gnumake/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/kmk/alloccache.c
r2633 r3140 38 38 * Header Files * 39 39 *******************************************************************************/ 40 #include "make .h"40 #include "makeint.h" 41 41 #include "dep.h" 42 42 #include "debug.h" … … 67 67 cache->free_head = f; 68 68 MAKE_STATS(cache->free_count++;); 69 #else 70 free(item); 71 #endif 69 #else /* CONFIG_WITH_ALLOCCACHE_DEBUG */ 70 71 struct alloccache **ppcache = (struct alloccache **)item - 1; 72 MY_ASSERT_MSG (*ppcache == cache, ("*ppcache=%p cache=%p item=%p\n", *ppcache, cache, item)); 73 *ppcache = NULL; 74 free(ppcache); 75 #endif /* CONFIG_WITH_ALLOCCACHE_DEBUG */ 72 76 } 73 77 … … 99 103 /* caller counts */ 100 104 return (struct alloccache_free_ent *)item; 101 #else 102 return (struct alloccache_free_ent *)xmalloc(cache->size); 103 #endif 105 #else /* CONFIG_WITH_ALLOCCACHE_DEBUG */ 106 107 /* Prefix the allocation with a cache pointer so alloccahce_free can better 108 catch incorrect calls. */ 109 struct alloccache **ppcache = (struct alloccache **)xmalloc(sizeof(*ppcache) + cache->size); 110 *ppcache = cache; 111 return (struct alloccache_free_ent *)(ppcache + 1); 112 #endif /* CONFIG_WITH_ALLOCCACHE_DEBUG */ 104 113 } 105 114
Note:
See TracChangeset
for help on using the changeset viewer.