Skip to content

Commit 5e9eed2

Browse files
committed
Fix KHASH_DEFAULT_SIZE to KHASH_INITIAL_SIZE rename inconsistencies
Commit 250bf6e renamed KHASH_DEFAULT_SIZE to KHASH_INITIAL_SIZE but missed updating build_config files and documentation. Also restore the default value in khash.h to 32, consistent with the documented default and the profile hierarchy (MRB_CONSTRAINED_BASELINE_PROFILE reduces it to 16).
1 parent a41eeae commit 5e9eed2

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

build_config/ArduinoDue.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#configuration for low memory environment
3232
cc.defines << %w(MRB_HEAP_PAGE_SIZE=64)
33-
cc.defines << %w(KHASH_DEFAULT_SIZE=8)
33+
cc.defines << %w(KHASH_INITIAL_SIZE=8)
3434
cc.defines << %w(MRB_GC_STRESS)
3535
#cc.defines << %w(MRB_NO_STDIO) #if you don't need stdio.
3636
#cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval

build_config/RX630.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#configuration for low memory environment
1717
cc.defines << %w(MRB_USE_FLOAT32)
1818
cc.defines << %w(MRB_HEAP_PAGE_SIZE=64)
19-
cc.defines << %w(KHASH_DEFAULT_SIZE=8)
19+
cc.defines << %w(KHASH_INITIAL_SIZE=8)
2020
cc.defines << %w(MRB_GC_STRESS)
2121
cc.defines << %w(MRB_NO_STDIO) #if you don't need stdio.
2222
#cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval

build_config/chipKITMax32.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#configuration for low memory environment
2929
cc.defines << %w(MRB_HEAP_PAGE_SIZE=64)
30-
cc.defines << %w(KHASH_DEFAULT_SIZE=8)
30+
cc.defines << %w(KHASH_INITIAL_SIZE=8)
3131
cc.defines << %w(MRB_GC_STRESS)
3232
#cc.defines << %w(MRB_NO_STDIO) #if you don't need stdio.
3333
#cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval

doc/guides/mrbconf.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ end
233233
- Specifies 4th argument(`argc`) max value of `mrb_funcall`.
234234
- Raises `ArgumentError` when the `argc` argument is bigger then this value `mrb_funcall`.
235235

236-
`KHASH_DEFAULT_SIZE`
236+
`KHASH_INITIAL_SIZE`
237237

238238
- Default value is `32`.
239-
- Specifies default size of khash table bucket.
239+
- Specifies initial size of khash table bucket.
240240
- Used in `kh_init_ ## name` function.
241241

242242
`MRB_NO_METHOD_CACHE`
@@ -272,7 +272,7 @@ deployment targets. Define one of the following:
272272
`MRB_CONSTRAINED_BASELINE_PROFILE`
273273

274274
- For micro controllers.
275-
- Enables `MRB_NO_METHOD_CACHE`, reduces `KHASH_DEFAULT_SIZE` to `16`,
275+
- Enables `MRB_NO_METHOD_CACHE`, reduces `KHASH_INITIAL_SIZE` to `16`,
276276
and `MRB_HEAP_PAGE_SIZE` to `256`.
277277

278278
`MRB_BASELINE_PROFILE`

include/mrbconf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
//#define MRB_GC_TURN_OFF_GENERATIONAL
140140

141141
/* default size of khash table bucket */
142-
//#define KHASH_DEFAULT_SIZE 32
142+
//#define KHASH_INITIAL_SIZE 32
143143

144144
/* allocated memory address alignment */
145145
//#define POOL_ALIGNMENT 4
@@ -208,8 +208,8 @@
208208
# define MRB_NO_METHOD_CACHE
209209
# endif
210210

211-
# ifndef KHASH_DEFAULT_SIZE
212-
# define KHASH_DEFAULT_SIZE 16
211+
# ifndef KHASH_INITIAL_SIZE
212+
# define KHASH_INITIAL_SIZE 16
213213
# endif
214214

215215
# ifndef MRB_HEAP_PAGE_SIZE

include/mruby/khash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ typedef uint32_t khint_t;
2121
typedef khint_t khiter_t;
2222

2323
#ifndef KHASH_INITIAL_SIZE
24-
# define KHASH_INITIAL_SIZE 8
24+
# define KHASH_INITIAL_SIZE 32
2525
#endif
2626
#define KHASH_MIN_SIZE 8
2727
#define KHASH_SMALL_LIMIT 4

0 commit comments

Comments
 (0)