725
726 // Retrieve native stack frames.
727 // Parameter:
728 // stack: an array to storage stack pointers.
729 // frames: size of above array.
730 // toSkip: number of stack frames to skip at the beginning.
731 // Return: number of stack frames captured.
732 static int get_native_stack(address* stack, int size, int toSkip = 0);
733
734 // General allocation (must be MT-safe)
735 static void* malloc (size_t size, MEMFLAGS flags, const NativeCallStack& stack);
736 static void* malloc (size_t size, MEMFLAGS flags);
737 static void* realloc (void *memblock, size_t size, MEMFLAGS flag, const NativeCallStack& stack);
738 static void* realloc (void *memblock, size_t size, MEMFLAGS flag);
739
740 static void free (void *memblock);
741 static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup
742 // Like strdup, but exit VM when strdup() returns NULL
743 static char* strdup_check_oom(const char*, MEMFLAGS flags = mtInternal);
744
745 #ifndef PRODUCT
746 static julong num_mallocs; // # of calls to malloc/realloc
747 static julong alloc_bytes; // # of bytes allocated
748 static julong num_frees; // # of calls to free
749 static julong free_bytes; // # of bytes freed
750 #endif
751
752 // SocketInterface (ex HPI SocketInterface )
753 static int socket(int domain, int type, int protocol);
754 static int socket_close(int fd);
755 static int recv(int fd, char* buf, size_t nBytes, uint flags);
756 static int send(int fd, char* buf, size_t nBytes, uint flags);
757 static int raw_send(int fd, char* buf, size_t nBytes, uint flags);
758 static int connect(int fd, struct sockaddr* him, socklen_t len);
759 static struct hostent* get_host_by_name(char* name);
760
761 // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
762 static void initialize_jdk_signal_support(TRAPS);
763 static void signal_notify(int signal_number);
764 static void* signal(int signal_number, void* handler);
|
725
726 // Retrieve native stack frames.
727 // Parameter:
728 // stack: an array to storage stack pointers.
729 // frames: size of above array.
730 // toSkip: number of stack frames to skip at the beginning.
731 // Return: number of stack frames captured.
732 static int get_native_stack(address* stack, int size, int toSkip = 0);
733
734 // General allocation (must be MT-safe)
735 static void* malloc (size_t size, MEMFLAGS flags, const NativeCallStack& stack);
736 static void* malloc (size_t size, MEMFLAGS flags);
737 static void* realloc (void *memblock, size_t size, MEMFLAGS flag, const NativeCallStack& stack);
738 static void* realloc (void *memblock, size_t size, MEMFLAGS flag);
739
740 static void free (void *memblock);
741 static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup
742 // Like strdup, but exit VM when strdup() returns NULL
743 static char* strdup_check_oom(const char*, MEMFLAGS flags = mtInternal);
744
745 static bool init_nestegg(size_t size);
746 static void release_nestegg();
747
748 #ifndef PRODUCT
749 static julong num_mallocs; // # of calls to malloc/realloc
750 static julong alloc_bytes; // # of bytes allocated
751 static julong num_frees; // # of calls to free
752 static julong free_bytes; // # of bytes freed
753 #endif
754
755 // SocketInterface (ex HPI SocketInterface )
756 static int socket(int domain, int type, int protocol);
757 static int socket_close(int fd);
758 static int recv(int fd, char* buf, size_t nBytes, uint flags);
759 static int send(int fd, char* buf, size_t nBytes, uint flags);
760 static int raw_send(int fd, char* buf, size_t nBytes, uint flags);
761 static int connect(int fd, struct sockaddr* him, socklen_t len);
762 static struct hostent* get_host_by_name(char* name);
763
764 // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
765 static void initialize_jdk_signal_support(TRAPS);
766 static void signal_notify(int signal_number);
767 static void* signal(int signal_number, void* handler);
|