mm.h | mm.h | |||
---|---|---|---|---|
skipping to change at line 65 | skipping to change at line 65 | |||
** ____ Public Part (I) of the API ________________________ | ** ____ Public Part (I) of the API ________________________ | |||
*/ | */ | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <string.h> | #include <string.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
typedef enum { | ||||
MM_LOCK_RD, MM_LOCK_RW | ||||
} mm_lock_mode; | ||||
/* | /* | |||
** ____ Private Part of the API ___________________________ | ** ____ Private Part of the API ___________________________ | |||
*/ | */ | |||
#if defined(MM_PRIVATE) | #if defined(MM_PRIVATE) | |||
#include "mm_conf.h" | #include "mm_conf.h" | |||
#include <errno.h> | #include <errno.h> | |||
#include <limits.h> | #include <limits.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <fcntl.h> | #include <fcntl.h> | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#ifdef MM_OS_SUNOS | #ifdef MM_OS_SUNOS | |||
#define KERNEL 1 | ||||
#include <memory.h> | #include <memory.h> | |||
/* SunOS lacks prototypes */ | /* SunOS lacks prototypes */ | |||
extern int getpagesize(void); | extern int getpagesize(void); | |||
extern int munmap(caddr_t addr, int len); | extern int munmap(caddr_t, int); | |||
extern int ftruncate(int fd, off_t length); | extern int ftruncate(int, off_t); | |||
extern int flock(int fd, int operation); | extern int flock(int, int); | |||
extern char *strerror (int err); | extern char *strerror(int); | |||
#endif | #endif | |||
#if !defined(FALSE) | #if !defined(FALSE) | |||
#define FALSE 0 | #define FALSE 0 | |||
#endif | #endif | |||
#if !defined(TRUE) | #if !defined(TRUE) | |||
#define TRUE !FALSE | #define TRUE !FALSE | |||
#endif | #endif | |||
#if !defined(NULL) | #if !defined(NULL) | |||
#define NULL (void *)0 | #define NULL (void *)0 | |||
skipping to change at line 292 | skipping to change at line 297 | |||
/* | /* | |||
** ____ Public Part (II) of the API _______________________ | ** ____ Public Part (II) of the API _______________________ | |||
*/ | */ | |||
#if defined(MM_PRIVATE) | #if defined(MM_PRIVATE) | |||
typedef mem_pool MM; | typedef mem_pool MM; | |||
#else | #else | |||
typedef void MM; | typedef void MM; | |||
#endif | #endif | |||
typedef enum { | ||||
MM_LOCK_RD, MM_LOCK_RW | ||||
} mm_lock_mode; | ||||
/* Global Malloc-Replacement API */ | /* Global Malloc-Replacement API */ | |||
int MM_create(size_t size, const char *file); | int MM_create(size_t size, const char *file); | |||
int MM_permission(mode_t mode, uid_t owner, gid_t group); | int MM_permission(mode_t mode, uid_t owner, gid_t group); | |||
void MM_destroy(void); | void MM_destroy(void); | |||
int MM_lock(mm_lock_mode mode); | int MM_lock(mm_lock_mode mode); | |||
int MM_unlock(void); | int MM_unlock(void); | |||
void *MM_malloc(size_t size); | void *MM_malloc(size_t size); | |||
void *MM_realloc(void *ptr, size_t size); | void *MM_realloc(void *ptr, size_t size); | |||
void MM_free(void *ptr); | void MM_free(void *ptr); | |||
void *MM_calloc(size_t number, size_t size); | void *MM_calloc(size_t number, size_t size); | |||
End of changes. 4 change blocks. | ||||
9 lines changed or deleted | 10 lines changed or added | |||