Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ced53e4bda17
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e094a70722ac
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on May 15, 2015

  1. Copy the full SHA
    5220915 View commit details
  2. Copy the full SHA
    e094a70 View commit details
Original file line number Diff line number Diff line change
@@ -268,6 +268,11 @@ public long getAtOffsetLong(RubyBasicObject pointer, int offset, int type) {
return getPointer(pointer).getLong(offset);
}

@Specialization(guards = "type == TYPE_STRING")
public RubyString getAtOffsetString(RubyBasicObject pointer, int offset, int type) {
return getContext().makeString(getPointer(pointer).getString(offset));
}

@Specialization(guards = "type == TYPE_PTR")
public RubyBasicObject getAtOffsetPointer(RubyBasicObject pointer, int offset, int type) {
final Pointer readPointer = getPointer(pointer).getPointer(offset);
Original file line number Diff line number Diff line change
@@ -135,42 +135,6 @@ public RubiniusConfiguration(RubyContext context) {
config("rbx.platform.timeval.tv_usec.size", SIZE_OF_LONG);
config("rbx.platform.timeval.tv_usec.type", "time_t");

/*
* struct addrinfo {
* int ai_flags;
* int ai_family;
* int ai_socktype;
* int ai_protocol;
* socklen_t ai_addrlen;
* char *ai_canonname; manpage on Darwin says these next two are swapped but header says otherwise
* struct sockaddr *ai_addr;
* struct addrinfo *ai_next;
* };
*/

int addrInfoOffset = 0;

for (String field : Arrays.asList("ai_flags", "ai_family", "ai_socktype", "ai_protocol")) {
config("rbx.platform.addrinfo." + field + ".offset", addrInfoOffset);
config("rbx.platform.addrinfo." + field + ".size", SIZE_OF_INT);
config("rbx.platform.addrinfo." + field + ".type", "int");
addrInfoOffset += SIZE_OF_INT;
}

config("rbx.platform.addrinfo.ai_addrlen.offset", addrInfoOffset);
config("rbx.platform.addrinfo.ai_addrlen.size", SIZE_OF_LONG);
config("rbx.platform.addrinfo.ai_addrlen.type", "long");
addrInfoOffset += SIZE_OF_LONG;

for (String field : Arrays.asList("ai_canonname", "ai_addr", "ai_next")) {
config("rbx.platform.addrinfo." + field + ".offset", addrInfoOffset);
config("rbx.platform.addrinfo." + field + ".size", SIZE_OF_POINTER);
config("rbx.platform.addrinfo." + field + ".type", "pointer");
addrInfoOffset += SIZE_OF_POINTER;
}

config("rbx.platform.addrinfo.sizeof", addrInfoOffset);

/*
* struct linger {
* int l_onoff;