]> granicus.if.org Git - gc/commitdiff
Prefix internal durango_get_mem symbol with 'GC_'
authorIvan Maidanski <ivmai@mail.ru>
Wed, 28 Nov 2018 09:03:04 +0000 (12:03 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 28 Nov 2018 09:44:51 +0000 (12:44 +0300)
(code refactoring of commit d16debf3e)

Issue #173 (bdwgc).

* include/private/gcconfig.h [MSWIN_XBOX1] (durango_get_mem): Rename
to GC_durango_get_mem; change return type from void* to ptr_t; remove
page_size argument.
* os_dep.c [MSWIN_XBOX1] (durango_get_mem): Likewise.
* include/private/gcconfig.h [MSWIN_XBOX1] (GET_MEM): Use
GC_durango_get_mem (instead of durango_get_mem).

include/private/gcconfig.h
os_dep.c

index 15a38375d7e2a5c1ef9791b87216ed44c5d5bea7..a5f81f4306f02533e5e26646c58995f7352f7f34 100644 (file)
@@ -3570,8 +3570,8 @@ EXTERN_C_BEGIN
                                                           GC_page_size)) \
                                   + GC_page_size - 1)
 # elif defined(MSWIN_XBOX1)
-    void *durango_get_mem(size_t bytes, size_t page_size);
-#   define GET_MEM(bytes) (struct hblk *)durango_get_mem(bytes, 0)
+    ptr_t GC_durango_get_mem(size_t bytes);
+#   define GET_MEM(bytes) (struct hblk *)GC_durango_get_mem(bytes)
 # elif defined(MSWIN32) || defined(CYGWIN32)
     ptr_t GC_win32_get_mem(size_t bytes);
 #   define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
index 85fa315021c4dfd367cc0831e476acd21df1fa4f..6d01684b2a0eb5751af6925ad6b70677d01040c3 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2301,16 +2301,14 @@ void * os2_alloc(size_t bytes)
 
 # endif /* OS2 */
 
-# ifdef MSWIN_XBOX1
-    void *durango_get_mem(size_t bytes, size_t page_size)
+#ifdef MSWIN_XBOX1
+    ptr_t GC_durango_get_mem(size_t bytes)
     {
       if (0 == bytes) return NULL;
-      return VirtualAlloc(NULL, bytes, MEM_COMMIT | MEM_TOP_DOWN,
-                          PAGE_READWRITE);
+      return (ptr_t)VirtualAlloc(NULL, bytes, MEM_COMMIT | MEM_TOP_DOWN,
+                                 PAGE_READWRITE);
     }
-# endif
-
-#ifdef MSWINCE
+#elif defined(MSWINCE)
   ptr_t GC_wince_get_mem(size_t bytes)
   {
     ptr_t result = 0; /* initialized to prevent warning. */