File: malloc.h

package info (click to toggle)
fs-uae 3.2.35-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,376 kB
  • sloc: cpp: 257,557; ansic: 121,965; sh: 4,895; makefile: 1,577; python: 446; asm: 275; xml: 10
file content (26 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef FS_MALLOC_H
#define FS_MALLOC_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef USE_GLIB

#include <glib.h>

#else

void *fs_malloc0(size_t n_bytes) FS_MALLOC /* G_GNUC_ALLOC_SIZE(1) */;

#define g_malloc0 fs_malloc0

#define g_new(struct_type, n_structs) (struct_type *) \
        malloc(sizeof(struct_type) * (n_structs))

#define g_new0(struct_type, n_structs) (struct_type *) \
        fs_malloc0(sizeof(struct_type) * (n_structs))

#endif

#endif /* FS_MALLOC_H */