Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166792116
D24297.id71250.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D24297.id71250.diff
View Options
Index: include/malloc.h
===================================================================
--- include/malloc.h
+++ include/malloc.h
@@ -1,6 +1,6 @@
-/* $FreeBSD$ */
-#if __STDC__
-#error "<malloc.h> has been replaced by <stdlib.h>"
-#else
+/*-
+ * This file is in the public domain.
+ * $FreeBSD$
+ */
#include <stdlib.h>
-#endif
+#include <malloc_np.h>
Index: include/malloc_np.h
===================================================================
--- include/malloc_np.h
+++ include/malloc_np.h
@@ -33,29 +33,33 @@
#ifndef _MALLOC_NP_H_
#define _MALLOC_NP_H_
-#include <sys/cdefs.h>
+
#include <sys/types.h>
-#include <stdbool.h>
-#include <strings.h>
+
+#ifdef __cplusplus
+#define __MyBool bool
+#else
+#define __MyBool _Bool
+#endif
__BEGIN_DECLS
typedef struct extent_hooks_s extent_hooks_t;
-typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *,
- bool *, unsigned);
-typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool,
- unsigned);
-typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool,
+typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t,
+ __MyBool *, __MyBool *, unsigned);
+typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool,
unsigned);
-typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
+typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool,
unsigned);
-typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t,
+typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t,
size_t, unsigned);
-typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
+typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t,
+ size_t, unsigned);
+typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
unsigned);
-typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
- bool, unsigned);
-typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t,
- bool, unsigned);
+typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
+ __MyBool, unsigned);
+typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t,
+ __MyBool, unsigned);
struct extent_hooks_s {
extent_alloc_t *alloc;
extent_dalloc_t *dalloc;
@@ -120,4 +124,6 @@
size_t __nallocx(size_t size, int flags);
__END_DECLS
+#undef __MyBool
+
#endif /* _MALLOC_NP_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 17, 5:08 PM (2 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36860205
Default Alt Text
D24297.id71250.diff (2 KB)
Attached To
Mode
D24297: Make include/malloc.h usable again.
Attached
Detach File
Event Timeline
Log In to Comment