Hi Christoph,
Thanks for the feedback. I've attached an update to the trackmem stuff
for review. globals.c is now unmodified.
Regards,
Barry.
> -----Original Message-----
> From: xfs-bounce@xxxxxxxxxxx [mailto:xfs-bounce@xxxxxxxxxxx]
> On Behalf Of Christoph Hellwig
> Sent: Friday, 9 March 2007 6:34 PM
> To: Barry Naujok
> Cc: xfs@xxxxxxxxxxx; xfs-dev@xxxxxxx
> Subject: Re: [PATCH] New xfs_repair handling for inode nlink counts
>
>
> +#ifdef TRACK_MEMORY
> +
> +#undef calloc
> +#undef malloc
> +#undef memalign
> +#undef realloc
> +#undef free
>
>
> Can you put all thise into a memory_tracking.h file that
> gets include with:
>
> #ifdef TRACK_MEMORY
> #include "track_memory.h"
> #endif
>
> Instead of polluting the implementation file?
>
> + /* add pointer to hash list, very basic simple hash function */
> + i = (((size_t)p) >> 8) & 0xff;
>
> + i = (((size_t)ptr) >> 8) & 0xff;
>
> Note that there is not guarantee that size_t and
> pointers have the
> same lenght, and there are system where it's not
> (win64?), better
> cast things use uintptr_t here.
>
> --- xfsprogs.orig/repair/globals.h
> +++ xfsprogs/repair/globals.h
> @@ -16,6 +16,16 @@
> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#ifdef TRACK_MEMORY
> +
> +#define calloc(n,s) track_calloc(__FILE__, __LINE__, (n), (s))
> +#define malloc(s) track_malloc(__FILE__, __LINE__, (s))
> +#define memalign(b,s) track_memalign(__FILE__,
> __LINE__, (b), (s))
> +#define realloc(p,s) track_realloc(__FILE__, __LINE__, (p), (s))
> +#define free(p) track_free(__FILE__, __LINE__, (p))
> +
> +#endif
> +
> #ifndef _XFS_REPAIR_GLOBAL_H
> #define _XFS_REPAIR_GLOBAL_H
>
> The memory tracking should probably come after the inclusion
> guards.
>
>
trackmem_update.patch
Description: Binary data
|