extern void *malloc __P((unsigned long size, ...));
extern void free __P((void *addr, ...));
#else
-#define malloc fbsd_malloc
-#define free fbsd_free
+#define malloc(size, flags, id) fbsd_malloc(size, __FILE__, __LINE__)
+#define free(area, flags) fbsd_free(area, __FILE__, __LINE__)
#endif
#endif /* KERNEL */
#endif /* !_SYS_MALLOC_H_ */
#ifdef __REACTOS__
#define MCLGET(m, how) { \
OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
- (m)->m_ext.ext_buf = malloc(MCLBYTES); \
+ (m)->m_ext.ext_buf = malloc(MCLBYTES,__FILE__,__LINE__); \
if ((m)->m_ext.ext_buf != NULL) { \
(m)->m_data = (m)->m_ext.ext_buf; \
(m)->m_flags |= M_EXT; \
}
#define MCLFREE(p) { \
- free( (p) ); \
+ free( (p), 0 ); \
}
#else
#define MCLGET(m, how) \
#define panic(...) do { printf(__VA_ARGS__); \
oskittcp_die(__FILE__,__LINE__); } while(0)
#endif//_MSC_VER
-#define kmem_malloc(x,y,z) malloc(y)
+#define kmem_malloc(x,y,z) malloc(y,0,0)
#endif//_OSKITFREEBSD_H
#undef errno
-void *fbsd_malloc( unsigned int bytes, ... );
-void fbsd_free( void *data, ... );
+void *fbsd_malloc( unsigned int bytes, char *file, unsigned line, ... );
+void fbsd_free( void *data, char *file, unsigned line, ... );
#if 0
#define malloc(x) fbsd_malloc(x,__FILE__,__LINE__)
#define free(x) fbsd_free(x,__FILE__,__LINE__)
<define name="_DISABLE_TIDENTS"/>
<define name="__USE_W32API"/>
<define name="__NO_CTYPE_INLINES" />
+ <define name="MEMTRACK" />
<include>drivers/lib/oskittcp/include/freebsd</include>
<include>drivers/lib/oskittcp/include/freebsd/sys/include</include>
<include>drivers/lib/oskittcp/include/freebsd/src/sys</include>
int isprint(int c);
int _snprintf(char * buf, size_t cnt, const char *fmt, ...);
-void *fbsd_malloc( unsigned int bytes, ... ) {
+void *fbsd_malloc( unsigned int bytes, char *file, unsigned line, ... ) {
if( !OtcpEvent.TCPMalloc ) panic("no malloc");
return OtcpEvent.TCPMalloc
- ( OtcpEvent.ClientData, (OSK_UINT)bytes, "*", 0 );
+ ( OtcpEvent.ClientData, (OSK_UINT)bytes, file, line );
}
-void fbsd_free( void *data, ... ) {
+void fbsd_free( void *data, char *file, unsigned line, ... ) {
if( !OtcpEvent.TCPFree ) panic("no free");
- OtcpEvent.TCPFree( OtcpEvent.ClientData, data, "*", 0 );
+ OtcpEvent.TCPFree( OtcpEvent.ClientData, data, file, line );
}
void InitOskitTCP() {