~ubuntu-branches/ubuntu/hardy/ntfs-3g/hardy

« back to all changes in this revision

Viewing changes to libntfs-3g/misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Florent Mertens
  • Date: 2006-09-27 12:00:49 UTC
  • Revision ID: james.westby@ubuntu.com-20060927120049-1hk9p6a42k58cv55
Tags: upstream-20060920
ImportĀ upstreamĀ versionĀ 20060920

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_CONFIG_H
 
2
#include "config.h"
 
3
#endif
 
4
 
 
5
#ifdef HAVE_STDLIB_H
 
6
#include <stdlib.h>
 
7
#endif
 
8
 
 
9
#include "misc.h"
 
10
#include "logging.h"
 
11
 
 
12
/**
 
13
 * ntfs_calloc
 
14
 * 
 
15
 * Return a pointer to the allocated memory or NULL if the request fails.
 
16
 */
 
17
void *ntfs_calloc(size_t size)
 
18
{
 
19
        void *p;
 
20
        
 
21
        p = calloc(1, size);
 
22
        if (!p)
 
23
                ntfs_log_perror("Failed to calloc %lld bytes", (long long)size);
 
24
        return p;
 
25
}
 
26
 
 
27
void *ntfs_malloc(size_t size)
 
28
{
 
29
        void *p;
 
30
        
 
31
        p = malloc(size);
 
32
        if (!p)
 
33
                ntfs_log_perror("Failed to malloc %lld bytes", (long long)size);
 
34
        return p;
 
35
}
 
36