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