Skip to content

Commit 02bc12f

Browse files
committed
win32/vmem.h: White-space only
Make this macro more legible, while silencing some compiler warnings about the if statements looking like they are intended to apply to more than they actually do.
1 parent ee1d728 commit 02bc12f

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

win32/vmem.h

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,33 @@ inline void MEMODSlx(char *str, long x)
6161
Even though perl links with ucrtbase.dll, there is alot of overhead for
6262
using ::new() operator. Just implement our own ::new(), more C-style. */
6363
#define VMEM_H_NEW_OP \
64-
void* operator new(size_t size) noexcept { \
65-
void * p = (void*)win32_malloc(size); \
66-
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \
67-
void* operator new[](size_t size) noexcept { \
68-
void * p = (void*)win32_malloc(size); \
69-
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \
70-
void* operator new( size_t size, int block_use, \
71-
char const* file_name, int line_number) noexcept { \
72-
UNREFERENCED_PARAMETER(block_use); \
73-
UNREFERENCED_PARAMETER(file_name); \
74-
UNREFERENCED_PARAMETER(line_number); \
75-
void * p = (void*)win32_malloc(size); \
76-
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; \
77-
}; \
78-
void* operator new[]( size_t size, int block_use, \
79-
char const* file_name, int line_number) noexcept { \
80-
UNREFERENCED_PARAMETER(block_use); \
81-
UNREFERENCED_PARAMETER(file_name); \
82-
UNREFERENCED_PARAMETER(line_number); \
83-
void * p = (void*)win32_malloc(size); \
84-
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \
85-
void operator delete (void* p) noexcept { win32_free(p); return; }; \
64+
void* operator new(size_t size) noexcept { \
65+
void * p = (void*)win32_malloc(size); \
66+
if (!p) noperl_die("%s%s","Out of memory in perl:", "???"); \
67+
return p; \
68+
}; \
69+
void* operator new[](size_t size) noexcept { \
70+
void * p = (void*)win32_malloc(size); \
71+
if (!p) noperl_die("%s%s","Out of memory in perl:", "???"); \
72+
return p; }; \
73+
void* operator new( size_t size, int block_use, \
74+
char const* file_name, int line_number) noexcept {\
75+
UNREFERENCED_PARAMETER(block_use); \
76+
UNREFERENCED_PARAMETER(file_name); \
77+
UNREFERENCED_PARAMETER(line_number); \
78+
void * p = (void*)win32_malloc(size); \
79+
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); \
80+
return p; \
81+
}; \
82+
void* operator new[]( size_t size, int block_use, \
83+
char const* file_name, int line_number) noexcept {\
84+
UNREFERENCED_PARAMETER(block_use); \
85+
UNREFERENCED_PARAMETER(file_name); \
86+
UNREFERENCED_PARAMETER(line_number); \
87+
void * p = (void*)win32_malloc(size); \
88+
if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); \
89+
return p; }; \
90+
void operator delete (void* p) noexcept { win32_free(p); return; }; \
8691
void operator delete[] (void* p) noexcept { win32_free(p); return; }
8792

8893

0 commit comments

Comments
 (0)