Created
September 20, 2018 09:09
-
-
Save holmeshe/f4c94a07e5fb7f2faef3ef9f6f66478a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void slabs_preallocate (const unsigned int maxslabs) { | |
| int i; | |
| unsigned int prealloc = 0; | |
| /* pre-allocate a 1MB slab in every size class so people don't get | |
| confused by non-intuitive "SERVER_ERROR out of memory" | |
| messages. this is the most common question on the mailing | |
| list. if you really don't want this, you can rebuild without | |
| these three lines. */ | |
| for (i = POWER_SMALLEST /* scr: 1 */; i < MAX_NUMBER_OF_SLAB_CLASSES; i++) { | |
| if (++prealloc > maxslabs) | |
| return; | |
| if (do_slabs_newslab(i) == 0) { | |
| fprintf(stderr, "Error while preallocating slab memory!\n" | |
| "If using -L or other prealloc options, max memory must be " | |
| "at least %d megabytes.\n", power_largest); | |
| exit(1); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment