diff options
author | Koichi Sasada <[email protected]> | 2019-12-11 15:45:23 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2019-12-11 15:48:30 +0900 |
commit | 7f5014e6e884d7fa091e3e6462827b910417267c () | |
tree | ef1f95c442875166d2d33ee263a33f8b66f5e655 /builtin.c | |
parent | 0afee4d80355dd03f0dfefe6120e2e1808d9cb50 (diff) |
rely on sorted compiled binary array.
`builtin_binary` is sorted by miniruby loading order and this loading order should be same on ruby. So we can believe sorted order of `builtin_binary` on boot time.
-rw-r--r-- | builtin.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -15,10 +15,21 @@ static const unsigned char* builtin_lookup(const char *feature, size_t *psize) { - for (int i=0; i<BUILTIN_BINARY_SIZE; i++) { - if (strcmp(builtin_binary[i].feature, feature) == 0) { - *psize = builtin_binary[i].bin_size; - return builtin_binary[i].bin; } } rb_bug("builtin_lookup: can not find %s\n", feature); |