Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/hotspot/os/aix/forbiddenFunctions_aix.hpp

This file was deleted.

4 changes: 1 addition & 3 deletions src/hotspot/os/aix/loadlib_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ class StringList {
}
}
assert0(_cap > _num);
BEGIN_ALLOW_FORBIDDEN_FUNCTIONS // Temp. until use of forbidden ::strdup fixed.
char* s2 = ::strdup(s);
END_ALLOW_FORBIDDEN_FUNCTIONS
char* s2 = permit_forbidden_function::strdup(s);
if (!s2) {
return nullptr;
}
Expand Down
30 changes: 0 additions & 30 deletions src/hotspot/os/bsd/forbiddenFunctions_bsd.hpp

This file was deleted.

30 changes: 0 additions & 30 deletions src/hotspot/os/linux/forbiddenFunctions_linux.hpp

This file was deleted.

6 changes: 5 additions & 1 deletion src/hotspot/share/utilities/forbiddenFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
#include <stddef.h> // for size_t
#include <stdlib.h> // clang workaround for exit, _exit, _Exit - see FORBID macro.

#include OS_HEADER(forbiddenFunctions)
#ifdef _WINDOWS
#include "forbiddenFunctions_windows.hpp"
#else
#include "forbiddenFunctions_posix.hpp"
#endif

// Forbid the use of various C library functions. Some of these have os::
// replacements that should be used instead. Others are considered obsolete
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/utilities/permitForbiddenFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ inline void free(void* ptr) { return ::free(ptr); }
inline void* calloc(size_t nmemb, size_t size) { return ::calloc(nmemb, size); }
inline void* realloc(void* ptr, size_t size) { return ::realloc(ptr, size); }

inline char* strdup(const char* s) { return ::strdup(s); }

END_ALLOW_FORBIDDEN_FUNCTIONS
} // namespace permit_forbidden_function

Expand Down